[issue36455] collections.abc.Sequence doesn't support reflection/introspection

2019-03-27 Thread James Edwards
James Edwards added the comment: Edit conflict -- indeed -- self closing. --- I should point out that this could be fixed with something like the following: @classmethod def __subclasshook__(cls, C): if cls is Sequence: return _check_methods(C, "__rever

[issue36455] collections.abc.Sequence doesn't support reflection/introspection

2019-03-27 Thread James Edwards
James Edwards added the comment: This was tagged as 3.7, but the issue still exists AFAICT in the latest github master: https://github.com/python/cpython/blob/master/Lib/_collections_abc.py -- ___ Python tracker <https://bugs.python.

[issue36455] collections.abc.Sequence doesn't support reflection/introspection

2019-03-27 Thread James Edwards
New submission from James Edwards : Consider: from collections.abc import * class DefinitelyNotAList: def __init__(self, backer): self.backer = backer def __getitem__(self, key): return self.backer[key] def __len__(self

[issue35989] ipaddress.IPv4Network allows prefix > 32

2019-03-05 Thread James Edwards
James Edwards added the comment: It may be worth also addressing the fact that IPv6Network makes no restriction on it's netmask (when specified as a tuple). -- nosy: +jedwards ___ Python tracker <https://bugs.python.org/is

[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2018-06-29 Thread James Edwards
Change by James Edwards : -- keywords: +patch pull_requests: +7617 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue25457> ___ ___ Py

[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2018-06-29 Thread James Edwards
James Edwards added the comment: This came up in a StackOverflow question[1] today, so I took a stab at addressing the error. The changes don't restore the 2.x behavior, but just do as R. David Murray suggested and coerce the keys to strings prior to sorting to prevent the error.

[issue24078] inspect.getsourcelines ignores context and returns wrong line #

2015-05-01 Thread James Edwards
James Edwards added the comment: Added Yury (inspect module) and Antoine (PEP 3155) to nosy -- apologies if you're not interested. -- ___ Python tracker <http://bugs.python.org/is

[issue24078] inspect.getsourcelines ignores context and returns wrong line #

2015-05-01 Thread James Edwards
Changes by James Edwards : -- nosy: +pitrou, yselivanov ___ Python tracker <http://bugs.python.org/issue24078> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24078] inspect.getsourcelines ignores context and returns wrong line #

2015-05-01 Thread James Edwards
James Edwards added the comment: Inspect could probably be updated to use 3.3's __qualname__ in the case of classes-in-classes; classes-in-functions or functions-in-functions would likely be harder, but I'm not sure it's impossible. --

[issue24035] When Caps Locked, + alpha-character still displayed as uppercase

2015-04-24 Thread James Edwards
James Edwards added the comment: It looks like this is a bug in pyreadlines as suggested by eryksun, but for a different reason. Even though the Caps Lock + Shift combination is recognized correctly (as lower case), the logic in the pyreadlines module forces it to upper case. See lines 44-45

[issue24035] When Caps Locked, + alpha-character still displayed as uppercase

2015-04-24 Thread James Edwards
James Edwards added the comment: If you start the interactive interpreter with the -S switch, e.g. >python.exe -S Do you still see this behavior? -- nosy: +jedwards ___ Python tracker <http://bugs.python.org/issu

[issue23990] Callable builtin doesn't respect descriptors

2015-04-17 Thread James Edwards
James Edwards added the comment: It seems like this issue has morphed over time. At the beginning, it looked like you expected perfectly reasonable (but odd) definitions of __call__ attributes, where the logic inside raised an Exception, to be somehow determined to be "uncallable&qu

[issue23986] Inaccuracy about "in" keyword for list and tuple

2015-04-17 Thread James Edwards
James Edwards added the comment: What about: For the list and tuple types, ``x in y`` is true if and only if there exists an -index *i* such that ``x == y[i]`` is true. +index *i* such that either ``x == y[i]`` or ``x is y[i]`` is true. Seems to address your issue, and match the semantics of

[issue23921] Standardize documentation whitespace, formatting

2015-04-14 Thread James Edwards
James Edwards added the comment: Attaching revised patch per reviews. Notable changes: * Reverted howto/curses.rst multiple inline statements -> multi-target assignment (curses.rst is now unchanged) * Reverted library/subprocess.rst "==>" to "# ==>" chang

[issue23921] Standardize documentation whitespace, formatting

2015-04-14 Thread James Edwards
James Edwards added the comment: Thanks for the review Serhiy. I'll prepare a revised patchset, given the comments from you and Berker and have it uploaded today. Thanks again. -- ___ Python tracker <http://bugs.python.org/is

[issue23921] Standardize documentation whitespace, formatting

2015-04-13 Thread James Edwards
James Edwards added the comment: Thanks Berker, I responded to most of your comments in rietveld. A few of your comments suggested "we should get rid of X", and while I can't say I disagree, I really tried to limit the scope of the changes to whitespace and formatting. As fa

[issue23921] Standardize documentation whitespace, formatting

2015-04-11 Thread James Edwards
Changes by James Edwards : -- versions: +Python 3.6 ___ Python tracker <http://bugs.python.org/issue23921> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23921] Standardize documentation whitespace, formatting

2015-04-11 Thread James Edwards
New submission from James Edwards: I realize this is a huge patch, I'd be happy to split it to multiple little patches (one per file, one per documentation directory, etc.) to make things easier. Just let me know. The patch attempts to do a few things (with exceptions, as noted

[issue23912] Inconsistent whitespace/formatting in docs/reference/datamodel/Special Method Lookup

2015-04-10 Thread James Edwards
New submission from James Edwards: There's inconsistent leading whitespace between the two classes in the 4th code snippet of the "Special Method Lookup" section. https://docs.python.org/3/reference/datamodel.html#special-method-lookup The (very substantial :) included p