-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
Description
Consider this example:
>>> class A:
... def __annotate__(format):
... print(f'{format=}')
... return {'a': int}
...
>>> A.__annotations__
format=1
{'a': <class 'int'>}
>>> A.__annotations__
{'a': <class 'int'>}
>>> del A.__annotations__
>>> A.__annotations__
format=1
{'a': <class 'int'>}
In this particular case __annotate__
is called twice. It works correctly in my opinion. But, I can't find any tests for such cases. Should I add tests for this?