Tim Mitchell <tim.mitch...@seequent.com> 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 dispatch table. This works by constructing the dispatch registry in the `__init_subclass__` method instead. ---------- Added file: https://bugs.python.org/file48261/singledispatchmethod.py _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36457> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com