Skip to content

Commit

Permalink
sss
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-morel committed Jun 9, 2024
1 parent e2170a7 commit a498c86
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/pyoload/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,8 +881,6 @@ def annotate_class(cls: Any, recur: bool = True):

if isinstance(cls, bool):
return partial(annotate_class, recur=cls)
if not hasattr(cls, "__annotations__"):
cls.__annotations__ = {}
recur = not hasattr(cls, "__pyod_norecur__") and recur
setter = cls.__setattr__
if recur:
Expand Down
14 changes: 7 additions & 7 deletions src/tests/logs.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type_match vs isinstance on int:True 1.5289682ms
type_match vs isinstance on int:False 1.9831642ms
type_match on dict[str, int]*50:True 267.711404ms
type_match on dict[str, int]*50:False 17.3794271ms
Cast str->int: 10.582962299999998ms
Cast complex->int | str: 0.50979833ms
Cast dict[int,list[str]*10]*10->dict[str,tuple[float]]: 12.46998271ms
type_match vs isinstance on int:True 2.4428162ms
type_match vs isinstance on int:False 2.7615315ms
type_match on dict[str, int]*50:True 265.3169892ms
type_match on dict[str, int]*50:False 17.7801438ms
Cast str->int: 10.9715787ms
Cast complex->int | str: 0.5133042ms
Cast dict[int,list[str]*10]*10->dict[str,tuple[float]]: 11.80671495ms
3 changes: 2 additions & 1 deletion src/tests/test_annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pyoload import Cast
from pyoload import annotable
from pyoload import annotate
from pyoload import annotate_class
from pyoload import is_annotable
from pyoload import is_annoted
from pyoload import resove_annotations
Expand All @@ -25,7 +26,7 @@ def foo1(a: Cast(str)):
return a


@annotate
@annotate_class(False)
class MyCLass:
__slots__ = ('a', 'b')
a: 'int'
Expand Down

0 comments on commit a498c86

Please sign in to comment.