This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author AlexWaygood
Recipients AlexWaygood, EugenePY, FFY00, Viktor Roytman, dmkulazhenko, glyph, levkivskyi, lukasz.langa, markgrandi, mental, ncoghlan, xtreak
Date 2021-10-17.21:40:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634506822.28.0.357548492943.issue39679@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-10-17 21:40:22AlexWaygoodsetrecipients: + AlexWaygood, ncoghlan, glyph, lukasz.langa, markgrandi, levkivskyi, xtreak, mental, Viktor Roytman, FFY00, EugenePY, dmkulazhenko
2021-10-17 21:40:22AlexWaygoodsetmessageid: <1634506822.28.0.357548492943.issue39679@roundup.psfhosted.org>
2021-10-17 21:40:22AlexWaygoodlinkissue39679 messages
2021-10-17 21:40:22AlexWaygoodcreate