[issue40066] Enum: modify __repr__, __str__; update docs

2021-06-30 Thread Michael Cuthbert
Michael Cuthbert added the comment: It may be helpful for the enum module to come with transitional functions like "pre310_str()" "pre310_repr()" "pre310_flag_str()" etc. so that people who are writing doctests that need to function on both < 3.10 and

[issue44139] Unparenthesized tuple doc bug in what's new

2021-05-14 Thread Michael Cuthbert
New submission from Michael Cuthbert : The What's New in Python 3.10 docs demonstrates a richer SyntaxError for this set comprehension: >>> {x,y for x,y in range(100)} File "", line 1 {x,y for x,y in range(100)} ^ SyntaxError: did you forget parentheses aroun

[issue17446] doctest test finder doesnt find line numbers of properties

2017-10-04 Thread Michael Cuthbert
Michael Cuthbert <cuthb...@mit.edu> added the comment: A pull request has been in for about a month -- is it possible to review or merge or comment? Thanks! -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue31412] wave.open does not accept PathLike objects

2017-09-10 Thread Michael Cuthbert
Changes by Michael Cuthbert <cuthb...@mit.edu>: -- keywords: +patch pull_requests: +3474 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31412] wave.open does not accept PathLike objects

2017-09-10 Thread Michael Cuthbert
Changes by Michael Cuthbert <cuthb...@mit.edu>: -- components: +Library (Lib) type: -> enhancement ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31412] wave.open does not accept PathLike objects

2017-09-10 Thread Michael Cuthbert
New submission from Michael Cuthbert: The wave library (reading and writing .wav audio files) accepts filehandles, strings, and bytes, but does not accept PathLike objects. Patch will modify wave.py to allow open to use these objects. -- messages: 301826 nosy: mscuthbert priority

[issue26904] Difflib quick_ratio() could use Counter()

2017-09-08 Thread Michael Cuthbert
Michael Cuthbert added the comment: I've tried to get the system to not be slower on small sets by not creating a Counter for less than 60 items, and managed to get within 10% of the speed for small sequences while maintaining the 3-3.6x speedup for big comparisons and testing

[issue17446] doctest test finder doesnt find line numbers of properties

2017-09-06 Thread Michael Cuthbert
Changes by Michael Cuthbert <cuthb...@mit.edu>: -- pull_requests: +3416 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17446> ___

[issue17446] doctest test finder doesnt find line numbers of properties

2017-05-15 Thread Michael Cuthbert
Michael Cuthbert added the comment: just poking to see if this patch is worth trying to get into 3.7 -- versions: +Python 3.7 -Python 2.7, Python 3.4, Python 3.5 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26904] Difflib quick_ratio() could use Counter()

2017-05-15 Thread Michael Cuthbert
Michael Cuthbert added the comment: Poking to see if there's still interest in getting this into 3.7. Thanks! -- versions: +Python 3.7 -Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26904] Difflib quick_ratio() could use Counter()

2016-05-03 Thread Michael Cuthbert
Michael Cuthbert added the comment: Here are the results I obtained along with the test code I used to get the results. The test code also has a "hybrid" code which I did not propose, but maybe I should have, which uses the old code for very short (but not degenerate) tests and th

[issue26904] Difflib quick_ratio() could use Counter()

2016-05-03 Thread Michael Cuthbert
Michael Cuthbert added the comment: @wolma -- you're right, that the inplace __iand__ version of Counter is substantially faster -- it is still slower than the current code (since it is still basically a superset of it). However, testing shows that it is close enough to the current code

[issue26904] Difflib quick_ratio() could use Counter()

2016-05-01 Thread Michael Cuthbert
New submission from Michael Cuthbert: The implementation used in difflib.SequenceMatcher().quick_ratio() counts how often each member of the sequence (character, list entry, etc.) appears in order to calculate its lower bound. Counting how often an entry appears in an iterable has been sped

[issue17446] doctest test finder doesnt find line numbers of properties

2016-03-21 Thread Michael Cuthbert
Michael Cuthbert added the comment: Here's a rather obscure bug that I was able to catch before we put this into action: doctests inside the __doc__ for namedtuples (and perhaps all namedtuples?) are instances of property, have .fget, but do not have .fget.__code__. Thus one more check

[issue17446] doctest test finder doesnt find line numbers of properties

2016-03-08 Thread Michael Cuthbert
Michael Cuthbert added the comment: looks like we're stuck on a style change (backslash to parens; ironic: I chose backslash to match surrounding code; I never use them myself). tuxtimo - could you fix this? (or I'll do once the move to github is done). Thanks

[issue17446] doctest test finder doesnt find line numbers of properties

2016-02-04 Thread Michael Cuthbert
Michael Cuthbert added the comment: The test looks great to me. Does anyone on nosy know the proper way to request a patch review? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue17446] doctest test finder doesnt find line numbers of properties

2016-01-31 Thread Michael Cuthbert
Michael Cuthbert added the comment: this is my first contribution to Python core so I really have no idea how to do this, but I have found a solution (works in Py3.4, 2.7): in doctest.py after line 1087 ("lineno = getattr(obj, 'co_firstlineno', None)-1") add these lines: