diff --git a/src/py_overload/__init__.py b/src/py_overload/__init__.py index 60ae9e6..e7d0552 100644 --- a/src/py_overload/__init__.py +++ b/src/py_overload/__init__.py @@ -131,7 +131,6 @@ def wrapper(*args, **kw): for k, v in vals.items(): if isinstance(anno[k], Cast): vals[k] = anno[k](v) - #(" casting", k, "to", anno[k]) continue if not typeMatch(v, anno[k]): if oload: @@ -140,7 +139,7 @@ def wrapper(*args, **kw): AnnotationError( f'Value: {v!r} does not match annotation: {anno[k]!r}' + f' for argument {k!r} of function {get_name(func)}', - ) + ), ) if len(errors) > 0: raise AnnotationErrors(errors) @@ -204,6 +203,7 @@ def annotateClass(cls): ), ), ) + def new_setter(self, name, value): if any(isinstance(x, str) for x in anno.values()): resolveAnnotations(anno, globals(), get_name(cls))