HW3 complete #2

Merged
zugzvangg merged 8 commits from hw3 into main 2023-10-27 11:32:46 +03:00
Showing only changes of commit 0ce2aa5941 - Show all commits

View File

@ -54,7 +54,6 @@ class TurtleDevice(SynchronyDevice):
raise NoSuchTrait
def invalidate(self, trait_name: str) -> None:
# NOTE: если я правильно понял, что должен делать метод
self.write(trait_name=trait_name, value=Turtle().__getattribute__(trait_name))
return
@ -88,10 +87,13 @@ class TurtleDevice(SynchronyDevice):
result = []
for method_name in methods:
method = getattr(self.turtle, method_name)
args = inspect.signature(method).parameters
parameters = inspect.signature(method).parameters
arg_types = {}
for arg_name, arg in args.items():
arg_types[arg_name] = arg.annotation
for arg_name, arg in parameters.items():
arg_types[arg_name] = parameters[arg_name].annotation
result.append(
ActionDescriptor(
name=method_name, info=method.__doc__, arguments=arg_types