Message404147
Happily, this bug appears to have been resolved in Python 3.10 due to the fact that a `classmethod` wrapping a function `F` will now have an `__annotations__` dict equal to `F`.
In Python 3.9:
```
>>> x = lambda y: y
>>> x.__annotations__ = {'y': int}
>>> c = classmethod(x)
>>> c.__annotations__
Traceback (most recent call last):
File "<pyshell#37>", line 1, in <module>
c.__annotations__
AttributeError: 'classmethod' object has no attribute '__annotations__'
```
In Python 3.10:
```
x = lambda y: y
x.__annotations__ = {'y': int}
c = classmethod(x)
c.__annotations__
{'y': <class 'int'>}
```
This change appears to have resolved the bug in `functools.singledispatchmethod`. The bug remains in Python 3.9, however. |
|
Date |
User |
Action |
Args |
2021-10-17 21:40:22 | AlexWaygood | set | recipients:
+ AlexWaygood, ncoghlan, glyph, lukasz.langa, markgrandi, levkivskyi, xtreak, mental, Viktor Roytman, FFY00, EugenePY, dmkulazhenko |
2021-10-17 21:40:22 | AlexWaygood | set | messageid: <1634506822.28.0.357548492943.issue39679@roundup.psfhosted.org> |
2021-10-17 21:40:22 | AlexWaygood | link | issue39679 messages |
2021-10-17 21:40:22 | AlexWaygood | create | |
|