[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 <https://bugs.python.org/issue36457> ___ ___ Python-bugs-list mailin

[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.pytho

[issue36744] functools.singledispatch: Shouldn't require a positional argument if there is only one keyword argument

2022-03-17 Thread Tim Mitchell
Tim Mitchell added the comment: I would really prefer the dispatch logic remains simple and fast, rather than handle single keyword arguments. -- nosy: +Tim Mitchell2 ___ Python tracker <https://bugs.python.org/issue36

[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

[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

[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-20 Thread Tim Mitchell
Tim Mitchell added the comment: Changes as per Martins review. -- Added file: http://bugs.python.org/file45159/subprocess3.patch ___ Python tracker <http://bugs.python.org/issue26

[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-18 Thread Tim Mitchell
Tim Mitchell added the comment: Am now working from tip of default in mercurial (Python 3.6). * Removed all changes to subprocess.rst. subprocess.__doc__ * Trimmed down even further - removed function signatures. * added note to see Python docs for complete description. Exception docs * just

[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-18 Thread Tim Mitchell
Tim Mitchell added the comment: hg patch with changes forthcoming -- ___ Python tracker <http://bugs.python.org/issue26240> ___ ___ Python-bugs-list mailin

[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-17 Thread Tim Mitchell
Tim Mitchell added the comment: Have stripped down the module __doc__ to a list of contents. I chose to indent the descriptions of each argument to Popen. I know this is non-standard but it is such a long ramble otherwise. Changed true -> :const:`True` in subprocess.rst. -- keywo

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-12 Thread Tim Mitchell
Tim Mitchell added the comment: Added test to patch -- ___ Python tracker <http://bugs.python.org/issue27946> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-12 Thread Tim Mitchell
Changes by Tim Mitchell : Removed file: http://bugs.python.org/file44605/0001-issue27946-Hold-reference-to-dict-in-PyDict_GetItem.patch ___ Python tracker <http://bugs.python.org/issue27

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-12 Thread Tim Mitchell
Changes by Tim Mitchell : Added file: http://bugs.python.org/file44611/0001-issue27946-Hold-reference-to-dict-in-PyDict_GetItem.patch ___ Python tracker <http://bugs.python.org/issue27

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-12 Thread Tim Mitchell
Tim Mitchell added the comment: see also similar dict issue 27945 -- ___ Python tracker <http://bugs.python.org/issue27946> ___ ___ Python-bugs-list mailin

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-12 Thread Tim Mitchell
Tim Mitchell added the comment: see also similar dict issue 27945 -- ___ Python tracker <http://bugs.python.org/issue27946> ___ ___ Python-bugs-list mailin

[issue27946] issues in elementtree and elsewhere due to PyDict_GetItem

2016-09-12 Thread Tim Mitchell
Tim Mitchell added the comment: Verified problem. Added patch to keep reference to dict in PyDict_GetItem. -- keywords: +patch nosy: +Tim Mitchell Added file: http://bugs.python.org/file44605/0001-issue27946-Hold-reference-to-dict-in-PyDict_GetItem.patch

[issue27945] Various segfaults with dict

2016-09-11 Thread Tim Mitchell
Tim Mitchell added the comment: Here is my patch for parts 3 and 4. Core issue for part 4 appears to be dk_lookup calling arbitrary python code may free the key. dk_lookup is also used in _PyDict_LoadGlobal not sure if this bug can occur here. -- nosy: +Tim Mitchell Added file: http