[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2022-03-17 Thread Tim Mitchell
Change by Tim Mitchell : Added file: https://bugs.python.org/file50689/test_sdm.py ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2022-03-17 Thread Tim Mitchell
Tim Mitchell added the comment: I've come up with a version that does not require a base class. Seems a bit hacky as the descriptor __get__ method now modifies the class to put the dispatch table in place the first time the method is accessed. -- Added file: https://bugs.python.org/f

[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2020-10-27 Thread Bojan Jovanovic
Change by Bojan Jovanovic : -- nosy: +bojan.jovanovic.gtech ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2020-06-08 Thread Łukasz Langa
Łukasz Langa added the comment: The proposed fix requires using a required base class which I'd like to avoid. -- ___ Python tracker ___ ___

[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2020-06-05 Thread Dries Schaumont
Dries Schaumont added the comment: I am interested in the fix, added myself to nosy list. -- nosy: +dschaumont ___ Python tracker ___ _

[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2019-04-11 Thread Tim Mitchell
Tim Mitchell added the comment: Attached is an improved implementation that does not use a module level register() function. It makes the code in the original post work as expected: The `@BaseVisitor.visit.register()` decorator on the `AVisitor` class does not modify the base class dispatc

[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2019-03-27 Thread Inada Naoki
Change by Inada Naoki : -- nosy: +lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2019-03-27 Thread Tim Mitchell
New submission from Tim Mitchell : The new functools.singledispatchmethod (issue32380) class interacts poorly with subclasses. There is no way for a sub-class to override or extend the dispatch registry. E.g. class BaseVistor: @singledispatchmethod def visit(self, obj): raise Value