[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-10-28 Thread Łukasz Langa
Łukasz Langa added the comment: Thanks for the 3.9 fix, Alex! ✨  ✨ -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-10-28 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 97388c204b557f30e48a2b2ef826868702204cf2 by Alex Waygood in branch '3.9': [3.9] bpo-39679: Fix `singledispatchmethod` `classmethod`/`staticmethod` bug (GH-29087) https://github.com/python/cpython/commit/97388c204b557f30e48a2b2ef826868702204cf2

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-10-20 Thread Alex Waygood
Change by Alex Waygood : -- pull_requests: +27353 pull_request: https://github.com/python/cpython/pull/29087 ___ Python tracker ___

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-10-19 Thread Łukasz Langa
Łukasz Langa added the comment: Thanks for the new tests, Alex. Not closing this just yet because maybe we find a way to fix it in 3.9.8+. -- ___ Python tracker ___

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-10-19 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset c15ba304f35362470e29ea5626fed28366bc9571 by Miss Islington (bot) in branch '3.10': bpo-39679: Add tests for classmethod/staticmethod singledispatchmethods (GH-29034) (GH-29072)

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-10-19 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset ad6d162e518963711d24c80f1b7d6079bd437584 by Alex Waygood in branch 'main': bpo-39679: Add tests for classmethod/staticmethod singledispatchmethods (GH-29034) https://github.com/python/cpython/commit/ad6d162e518963711d24c80f1b7d6079bd437584

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-10-19 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 12.0 -> 13.0 pull_requests: +27340 pull_request: https://github.com/python/cpython/pull/29072 ___ Python tracker

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-10-18 Thread Alex Waygood
Change by Alex Waygood : -- keywords: +patch pull_requests: +27305 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29034 ___ Python tracker ___

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-10-17 Thread Alex Waygood
Alex Waygood added the comment: 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

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-06-16 Thread Dmitry Kulazhenko
Change by Dmitry Kulazhenko : -- nosy: +EugenePY, FFY00, Viktor Roytman, glyph, levkivskyi, lukasz.langa, markgrandi, mental, ncoghlan, xtreak ___ Python tracker ___

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-06-16 Thread Dmitry Kulazhenko
Dmitry Kulazhenko added the comment: Based on what I've read, workaround: from functools import singledispatchmethod def _register(self, cls, method=None): if hasattr(cls, "__func__"): setattr(cls, "__annotations__", cls.__func__.__annotations__) return

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2020-11-09 Thread mental
Change by mental : -- nosy: +mental ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2020-11-02 Thread Eugene-Yuan Kou
Eugene-Yuan Kou added the comment: Hi, I also encounter to the problem, and I have give my attempt to make the singledispatchmethod support the classmethod, and staticmethod with type annotation. I also adding two tests. Please refer to my fork. I will trying to make a pull request

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2020-10-12 Thread Filipe Laíns
Change by Filipe Laíns : -- nosy: +FFY00 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2020-10-09 Thread Glyph Lefkowitz
Glyph Lefkowitz added the comment: I also just discovered this. I thought it must have regressed at some point but I see the docs say "new in 3.8" and I'm using 3.8. Is there a "no CI for examples in the docs" issue that this could be linked to? -- nosy: +glyph

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2020-06-25 Thread Mark Grandi
Mark Grandi added the comment: same issue here, if we can't fix it then maybe we should edit the documentation to not suggest that @classmethod works? -- nosy: +markgrandi ___ Python tracker

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2020-06-10 Thread Viktor Roytman
Viktor Roytman added the comment: Sorry to bump this after months of inactivity but is there something I need to do here? -- ___ Python tracker ___

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2020-02-21 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Sorry, I had the part only to detect annotations attached. My part is something similar to yours except it stores the appropriate function in the registry itself instead of passing the arguments at __get__ . --

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2020-02-21 Thread Viktor Roytman
Viktor Roytman added the comment: I tried to apply this change but it didn't work, failing with this error $ ~/.pyenv/versions/3.8.1/bin/python -m bad_classmethod_as_documented Traceback (most recent call last): File "/home/viktor/.pyenv/versions/3.8.1/lib/python3.8/runpy.py",

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2020-02-18 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I guess the method checks for annotation on cls [0] which will be classmethod/staticmethod object in the report and won't have annotations. The annotations should be looked up in the function the classmethod/staticmethod decorator wraps around as

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2020-02-18 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39679] functools: singledispatchmethod doesn't work with classmethod

2020-02-18 Thread Viktor Roytman
New submission from Viktor Roytman : I couldn't get the example given for the interaction between @singledispatchmethod and @classmethod to work https://docs.python.org/3/library/functools.html?highlight=singledispatch#functools.singledispatchmethod from functools import