Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-morel committed May 2, 2024
1 parent 84a7f9d commit 1029e7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/py_overload/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 1029e7a

Please sign in to comment.