[issue41621] defaultdict miss behave when using default_factory passed as kwargs

2020-08-24 Thread Dennis Sweeney
Dennis Sweeney added the comment: PR 21945 changes the signature: - defaultdict(default_factory[, ...]) + defaultdict(default_factory=None, /, [...]) -- ___ Python tracker <https://bugs.python.org/issue41

[issue41621] defaultdict miss behave when using default_factory passed as kwargs

2020-08-24 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch nosy: +Dennis Sweeney nosy_count: 3.0 -> 4.0 pull_requests: +21055 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21945 ___ Python tracker <https://bugs.p

[issue41545] gc API requiring matching number of gc.disable - gc.enable calls

2020-08-17 Thread Dennis Sweeney
Dennis Sweeney added the comment: FWIW I forgot the gc.disable() line in the contextmanager, but what I said still applies. -- ___ Python tracker <https://bugs.python.org/issue41

[issue41545] gc API requiring matching number of gc.disable - gc.enable calls

2020-08-17 Thread Dennis Sweeney
Dennis Sweeney added the comment: The save-a-boolean-for-each-context-manager approach has an issue if used with concurrent generators, where the lifetimes of two generator objects might be overlapping but not completely nested, as shown below. The same issue should arise when using

[issue41545] gc API requiring matching number of gc.disable - gc.enable calls

2020-08-15 Thread Dennis Sweeney
Dennis Sweeney added the comment: This is exactly the motivation for context managers, no? I attached no_gc.py, which works when nested and should additionally be thread-safe. Usage: from no_gc import no_gc with no_gc(): # collection disabled with no_gc(): # collection

[issue29269] test_socket failing in solaris

2020-08-01 Thread Dennis Clarke
Dennis Clarke added the comment: Well here we are in 2020 and Solaris systems are still running just fine. In fact, some big Fujitsu SPARC systems are running in production for years and years and also, no surprise, this test still fails horrifically on old stable Solaris 10. Python

[issue41356] Convert bool.__new__ to argument clinic

2020-07-22 Thread Dennis Sweeney
Dennis Sweeney added the comment: More microbenchmarks: pyperf timeit "bool()" Before: 63.1 ns +- 0.7 ns After: 51.7 ns +- 1.2 ns pyperf timeit "bool(0)" Before: 77.4 ns +- 1.9 ns After: 67.2 ns +- 1.3 ns pyperf timeit "bool(17)" Befor

[issue41356] Convert bool.__new__ to argument clinic

2020-07-21 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +20723 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21581 ___ Python tracker <https://bugs.python.org/issu

[issue41356] Convert bool.__new__ to argument clinic

2020-07-21 Thread Dennis Sweeney
New submission from Dennis Sweeney : Benchmarked on my machine (Windows 10): .\python.bat -m pyperf timeit -s "from collections import deque; x = [[], [1]] * 1_000_000" "deque(map(bool, x), maxlen=0)" --- Win32 build configuration --- Master:

[issue41299] Python3 threading.Event().wait time is twice as large as Python27

2020-07-15 Thread Dennis Sweeney
Dennis Sweeney added the comment: I reproduced something similar on Python 3.9.0b1, Windows 64-bit version: py -m pyperf timeit -s "import threading; E = threading.Event()" "E.wait()" NUMBERMean +- std dev --- 0.0

[issue41166] CLASS ATTRIBUTES

2020-06-30 Thread Dennis Sweeney
Dennis Sweeney added the comment: I think the word "attribute" is preferred over "value" because "value" can mean just about anything, whereas, according to https://docs.python.org/3/glossary.html?highlight=glossary , an attribute is specifically: ""

[issue40890] Dict views should be introspectable

2020-06-14 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +20061 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/20873 ___ Python tracker <https://bugs.python.org/issu

[issue40925] Remove redundant macros used for stack manipulation in interpreter

2020-06-12 Thread Dennis Sweeney
Change by Dennis Sweeney : Removed file: https://bugs.python.org/file49229/master_perf.txt ___ Python tracker <https://bugs.python.org/issue40925> ___ ___ Python-bug

[issue40925] Remove redundant macros used for stack manipulation in interpreter

2020-06-12 Thread Dennis Sweeney
Change by Dennis Sweeney : Removed file: https://bugs.python.org/file49228/pushpop_perf.txt ___ Python tracker <https://bugs.python.org/issue40925> ___ ___ Python-bug

[issue40925] Remove redundant macros used for stack manipulation in interpreter

2020-06-12 Thread Dennis Sweeney
Change by Dennis Sweeney : Added file: https://bugs.python.org/file49230/perf_diff.txt ___ Python tracker <https://bugs.python.org/issue40925> ___ ___ Python-bugs-list m

[issue40925] Remove redundant macros used for stack manipulation in interpreter

2020-06-12 Thread Dennis Sweeney
Change by Dennis Sweeney : Added file: https://bugs.python.org/file49229/master_perf.txt ___ Python tracker <https://bugs.python.org/issue40925> ___ ___ Python-bug

[issue40925] Remove redundant macros used for stack manipulation in interpreter

2020-06-12 Thread Dennis Sweeney
Dennis Sweeney added the comment: I just added PR 20845, but I'm concerned about performance. I'm attaching the results of a run of pyperformance before and after PR 20845. -- Added file: https://bugs.python.org/file49228/pushpop_perf.txt

[issue40925] Remove redundant macros used for stack manipulation in interpreter

2020-06-12 Thread Dennis Sweeney
Change by Dennis Sweeney : -- nosy: +Dennis Sweeney nosy_count: 3.0 -> 4.0 pull_requests: +20038 pull_request: https://github.com/python/cpython/pull/20845 ___ Python tracker <https://bugs.python.org/issu

[issue40890] Dict views should be introspectable

2020-06-12 Thread Dennis Sweeney
Dennis Sweeney added the comment: Would it be better to have a dictview.mapping() method rather than an attribute, since it constructs a new object of a different type and since that's what keys(), values(), and items() are? -- ___ Python tracker

[issue40890] Dict views should be introspectable

2020-06-08 Thread Dennis Sweeney
Dennis Sweeney added the comment: Here's a workaround that's possible with PR 20749 applied: >>> d = {"a":1, "b":2} # fill up the dict... >>> DICT = object() >>> d[DICT] = d >>> items = d.items() >>> del

[issue40890] Dict views should be introspectable

2020-06-08 Thread Dennis Sweeney
Dennis Sweeney added the comment: PR 20749 gives each dict view access to a mappingproxy for the original dict, although I don't know if that defeats the original purpose. It might be hard to sensibly make MappingProxy(d).items() return something other than d.items(), since this is already

[issue40890] Dict views should be introspectable

2020-06-08 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +19954 pull_request: https://github.com/python/cpython/pull/20749 ___ Python tracker <https://bugs.python.org/issue40

[issue40889] Symmetric difference on dict_views is inefficient

2020-06-08 Thread Dennis Sweeney
Dennis Sweeney added the comment: A demo: >>> class Int(int): ... hash_calls = 0 ... def __hash__(self): ... Int.hash_calls += 1 ... return super().__hash__() ... >>> left = {Int(1): -1, Int(2): -2, Int(3): -3, Int(4): -4, Int(5): -5, Int(6):

[issue40889] Symmetric difference on dict_views is inefficient

2020-06-08 Thread Dennis Sweeney
Dennis Sweeney added the comment: PR 20718 helps somewhat by only creating and hashing the tuples that wind up in the final set. Here's a benchmark: -m pyperf timeit -s "d1 = {i:i for i in range(100_000)}; d2 = {i:i|1 for i in range(100_000)}" "d1.items() ^ d2.items()"

[issue40889] Symmetric difference on dict_views is inefficient

2020-06-08 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +19928 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20718 ___ Python tracker <https://bugs.python.org/issu

[issue40889] Symmetric difference on dict_views is inefficient

2020-06-07 Thread Dennis Sweeney
Dennis Sweeney added the comment: What about returning another dict_items instead of a set? As in (using the convention `d.items().mapping is d`): dict_items = type({}.items()) def __xor__(self: dict_items, other): if isinstance(other, dict_items): new

[issue40890] Dict views should be introspectable

2020-06-07 Thread Dennis Sweeney
Dennis Sweeney added the comment: Would the best way to address this be adding new KeysProxy, ValuesProxy, and ItemsProxy types? -- ___ Python tracker <https://bugs.python.org/issue40

[issue40890] Dict views should be introspectable

2020-06-07 Thread Dennis Sweeney
Dennis Sweeney added the comment: Indeed, with PR 20691 applied, the following crashes: >>> vars(str).items().mapping.clear() >>> "uh oh" -- ___ Python tracker <htt

[issue40890] Dict views should be introspectable

2020-06-07 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +19906 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20691 ___ Python tracker <https://bugs.python.org/issu

[issue40890] Dict views should be introspectable

2020-06-07 Thread Dennis Sweeney
Dennis Sweeney added the comment: I think this will also require typing.MappingProxyType to change a bit, since it would make a proxy's underlying dict accessible: >>> d = dict() >>> proxy = MappingProxyType(d) >>> type(proxy.items()) is type(d.

[issue40890] Dict views should be introspectable

2020-06-07 Thread Dennis Sweeney
Dennis Sweeney added the comment: I'd be happy to write a PR. Method names could be "mapping", "target", "target_mapping", "target_dict", "referent_dict", etc. I like the choice of "target_mapping": d = dict()

[issue40879] Strange regex cycle

2020-06-05 Thread Dennis Sweeney
Dennis Sweeney added the comment: It looks like only the first 200 characters of the input string's repr are used as the compiled pattern's repr for some reason: https://github.com/python/cpython/blob/master/Modules/_sre.c#L1294 I don't know if there is a good reason, especially since

[issue38938] Possible performance improvement for heapq.merge()

2020-05-30 Thread Dennis Sweeney
Dennis Sweeney added the comment: PR 20550 uses a linked structure like what we've been talking about. -- ___ Python tracker <https://bugs.python.org/issue38

[issue38938] Possible performance improvement for heapq.merge()

2020-05-30 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +19794 pull_request: https://github.com/python/cpython/pull/20550 ___ Python tracker <https://bugs.python.org/issue38

[issue25782] CPython hangs on error __context__ set to the error itself

2020-05-30 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +19788 pull_request: https://github.com/python/cpython/pull/20539 ___ Python tracker <https://bugs.python.org/issue25

[issue25782] CPython hangs on error __context__ set to the error itself

2020-05-30 Thread Dennis Sweeney
Dennis Sweeney added the comment: For clarification, the existing behavior on master: When trying to raise the exception H, F -> G -> H -> I -> NULL becomes H -> F -> G -> NULL But when trying to set the exception A on top of

[issue40696] exception chain cycles cause hangs (was "Exception handling with "await" can hang in Python3.9.0b1")

2020-05-30 Thread Dennis Sweeney
Dennis Sweeney added the comment: > I it related to issue25782? Yes -- I didn't see that issue. I'm a little confused about the resolution of that issue though. For clarification, the existing behavior on master: When trying to raise the exception H, F -> G -> H -&g

[issue40696] exception chain cycles cause hangs (was "Exception handling with "await" can hang in Python3.9.0b1")

2020-05-30 Thread Dennis Sweeney
Dennis Sweeney added the comment: I believe PR 20539 solves the more general problem (using Floyd's Tortoise and Hare Algorithm), and I would appreciate review / some more ideas for test cases. -- ___ Python tracker <https://bugs.python.

[issue40696] exception chain cycles cause hangs (was "Exception handling with "await" can hang in Python3.9.0b1")

2020-05-30 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +19782 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/20539 ___ Python tracker <https://bugs.python.org/issu

[issue38938] Possible performance improvement for heapq.merge()

2020-05-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: less_movement.py is my favorite so far. It still handles key and reverse, but using instance attributes instead of the list indices I tried before. It does this by only advancing the "key" and "leaf" attributes up toward the root (w

[issue40696] exception chain cycles cause hangs (was "Exception handling with "await" can hang in Python3.9.0b1")

2020-05-22 Thread Dennis Sweeney
Dennis Sweeney added the comment: Wouldn't Floyd's or Brent's cycle detection algorithms be better here than the allocation of a new set? I believe they might also eliminate the need to fast-path the first 100 or however many. As in: https://en.wikipedia.org/wiki/Cycle_detection

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-22 Thread Dennis Sweeney
Dennis Sweeney added the comment: key_and_reverse.py employs the same strategy as winners.py, but uses lists as the nodes of the tree rather than using Node instances. It also eliminates the recursion of treeify, and adds (with neither much of a performance hit nor much code duplication

[issue40722] test_ttk_guionly times out on Ubuntu CI

2020-05-21 Thread Dennis Sweeney
New submission from Dennis Sweeney : One of the tests (test_ttk_guionly.test_variable_change) on the Ubuntu CI is intermittently hanging on this code: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Lib/tkinter/test/test_ttk/test_extensions.py#L147

[issue40679] show class name in method invocation TypeError

2020-05-21 Thread Dennis Sweeney
Dennis Sweeney added the comment: https://bugs.python.org/issue40706 -- ___ Python tracker <https://bugs.python.org/issue40679> ___ ___ Python-bugs-list mailin

[issue40706] Unreachable code in _PyEval_EvalCode

2020-05-21 Thread Dennis Sweeney
New submission from Dennis Sweeney : When I was looking into https://bugs.python.org/issue40679, I couldn't come up with a test case for the following block, so I added a print statement: --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4179,6 +4179,7 @@ _PyEval_EvalCode(PyThreadState *tstate

[issue40679] show class name in method invocation TypeError

2020-05-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: Sure -- I'll file the issue. -- ___ Python tracker <https://bugs.python.org/issue40679> ___ ___ Python-bugs-list mailin

[issue40679] show class name in method invocation TypeError

2020-05-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: I just ran the entire test suite with: --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4179,6 +4179,7 @@ _PyEval_EvalCode(PyThreadState *tstate, Py_ssize_t j; if (keyword == NULL || !PyUnicode_Check(keyword)) { +printf("THIS

[issue40679] show class name in method invocation TypeError

2020-05-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: Never mind; I think you're right, and https://github.com/python/cpython/blob/master/Objects/call.c#L1009 is the line. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40679] show class name in method invocation TypeError

2020-05-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: I got this: >>> class A: ... def f(): ... pass ... >>> A.f(1) Traceback (most recent call last): File "", line 1, in TypeError: A.f() takes 0 positional arguments but 1 was given >>> A.f(**{1:2}) Traceback (most

[issue40679] show class name in method invocation TypeError

2020-05-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: While trying to write tests, I stumbled across something interesting: _PyObject_FunctionString as discussed here ( https://bugs.python.org/issue37645 ) returns a string that also includes the module name where applicable. For example, the module name

[issue40679] show class name in method invocation TypeError

2020-05-19 Thread Dennis Sweeney
Dennis Sweeney added the comment: The attached PR isn't exactly what you requested, but it's a very minimal code change that uses the existing __qualname__ functionality to change the message to TypeError: A.foo() takes 1 positional argument but 2 were given Does that address those

[issue40679] show class name in method invocation TypeError

2020-05-19 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch nosy: +Dennis Sweeney nosy_count: 2.0 -> 3.0 pull_requests: +19523 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20236 ___ Python tracker <https://bugs.p

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-18 Thread Dennis Sweeney
Dennis Sweeney added the comment: I mostly like new_merge.py too, especially the dynamic reduction of the tree. However, it looks like ``list(merge([2],[1],[1]))`` currently fails, and I think what's missing is the following in the sibling-promotion: + if sibling.left

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-17 Thread Dennis Sweeney
Change by Dennis Sweeney : Added file: https://bugs.python.org/file49167/losers.py ___ Python tracker <https://bugs.python.org/issue38938> ___ ___ Python-bugs-list mailin

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-17 Thread Dennis Sweeney
Change by Dennis Sweeney : Removed file: https://bugs.python.org/file49165/losers.py ___ Python tracker <https://bugs.python.org/issue38938> ___ ___ Python-bugs-list m

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-17 Thread Dennis Sweeney
Dennis Sweeney added the comment: It seems to me that the code sprawl mostly comes from the separate handling of the four keyed/unkeyed and forward/reverse cases, which as far as I can tell requires a branch in the innermost loop if not unrolled into separate cases. I think

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-17 Thread Dennis Sweeney
Change by Dennis Sweeney : Added file: https://bugs.python.org/file49166/recursive_merge.py ___ Python tracker <https://bugs.python.org/issue38938> ___ ___ Python-bug

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-17 Thread Dennis Sweeney
Change by Dennis Sweeney : Added file: https://bugs.python.org/file49165/losers.py ___ Python tracker <https://bugs.python.org/issue38938> ___ ___ Python-bugs-list mailin

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-17 Thread Dennis Sweeney
Change by Dennis Sweeney : Added file: https://bugs.python.org/file49164/tournament_heap.py ___ Python tracker <https://bugs.python.org/issue38938> ___ ___ Python-bug

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-17 Thread Dennis Sweeney
Change by Dennis Sweeney : Removed file: https://bugs.python.org/file48748/merge_recipe.py ___ Python tracker <https://bugs.python.org/issue38938> ___ ___ Python-bug

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-17 Thread Dennis Sweeney
Change by Dennis Sweeney : Removed file: https://bugs.python.org/file49156/recursive_merge.py ___ Python tracker <https://bugs.python.org/issue38938> ___ ___ Python-bug

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-17 Thread Dennis Sweeney
Change by Dennis Sweeney : Removed file: https://bugs.python.org/file48747/iter_merge.py ___ Python tracker <https://bugs.python.org/issue38938> ___ ___ Python-bug

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-15 Thread Dennis Sweeney
Dennis Sweeney added the comment: The attached recursive_merge.py should be much less ugly and still somewhat performant. It should be the same algorithm as that PR, just written recursively rather than iteratively. I got some text files from http://www.gwicks.net/dictionaries.htm

[issue38938] Possible performance improvement for heaqq.merge()

2020-05-15 Thread Dennis Sweeney
Dennis Sweeney added the comment: As Serhiy suggested, keeping the algorithm but moving the Python implementation to be a generator again (as I recently changed in PR 18427) gives another performance boost (although this unrolling is many lines of code). Timing the C implementation

[issue40582] Inconsistent exceptions caused by typing + tuple subclasses

2020-05-10 Thread Dennis Sweeney
Change by Dennis Sweeney : -- nosy: +gvanrossum, levkivskyi ___ Python tracker <https://bugs.python.org/issue40582> ___ ___ Python-bugs-list mailing list Unsub

[issue40582] Inconsistent exceptions caused by typing + tuple subclasses

2020-05-09 Thread Dennis Sweeney
Dennis Sweeney added the comment: I think the behavior is consistent between tuple and an empty subclass: >>> from typing import List >>> class T(tuple): pass == Empty tuple/T == >>> List[()] Traceback (most recent call last):

[issue40028] Math module method to find prime factors for non-negative int n

2020-05-06 Thread Dennis Sweeney
Dennis Sweeney added the comment: For some more ideas for features or APIs, you could look at: https://docs.sympy.org/latest/modules/ntheory.html or http://doc.sagemath.org/html/en/reference/rings_standard/sage/arith/misc.html for an absolute upper bound. If there's to be a minimal number

[issue40504] Restore weakref support for lru_cache wrappers

2020-05-05 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +19253 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19938 ___ Python tracker <https://bugs.python.org/issu

[issue40504] Restore weakref support for lru_cache wrappers

2020-05-04 Thread Dennis Sweeney
Dennis Sweeney added the comment: I can submit a PR. Just making sure I understand, is this essentially the desired behavior change? import weakref import functools if 0: from test.support import import_fresh_module functools = import_fresh_module('functools', blocked=['_functools

[issue40459] [easy] undefined names in platform.py

2020-05-01 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch nosy: +Dennis Sweeney nosy_count: 1.0 -> 2.0 pull_requests: +19171 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19855 ___ Python tracker <https://bugs.p

[issue40472] IDLE Shell not allowing more than two line inputs

2020-05-01 Thread Dennis Sweeney
Dennis Sweeney added the comment: git bisect says that this was fixed here: commit b94dbd7ac34dc0c79512656eb17f6f07e09fca7a Author: Pablo Galindo Date: Mon Apr 27 18:35:58 2020 +0100 bpo-40334: Support PyPARSE_DONT_IMPLY_DEDENT in the new parser (GH-19736) -- nosy: +Dennis

[issue40418] Small Refactoring: Use bytes.hex() in secrets.token_hex()

2020-04-28 Thread Dennis Sweeney
Change by Dennis Sweeney : -- title: Small Refactoring: Use the bytes.hex() in secrets.token_hex() -> Small Refactoring: Use bytes.hex() in secrets.token_hex() ___ Python tracker <https://bugs.python.org/issu

[issue40418] Small Refactoring: Use the bytes.hex() in secrets.token_hex()

2020-04-28 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +19070 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19749 ___ Python tracker <https://bugs.python.org/issu

[issue40418] Small Refactoring: Use the bytes.hex() in secrets.token_hex()

2020-04-28 Thread Dennis Sweeney
New submission from Dennis Sweeney : Since bytes.hex() was added in 3.5, we should be able to make the following change: diff --git a/Lib/secrets.py b/Lib/secrets.py index a546efbdd4..1dd8629f52 100644 --- a/Lib/secrets.py +++ b/Lib/secrets.py @@ -13,7 +13,6 @@ __all__

[issue40380] OS-related test failures on Linux in Python 3.8.2

2020-04-25 Thread Dennis Sweeney
Change by Dennis Sweeney : -- components: +Tests -Installation title: Errors during make test python 3.8.2 -> OS-related test failures on Linux in Python 3.8.2 type: compile error -> behavior ___ Python tracker <https://bugs.python.org/i

[issue40380] Errors during make test python 3.8.2

2020-04-25 Thread Dennis Sweeney
Dennis Sweeney added the comment: Thanks for reaching out! This is about test failures, not problems with installation process, correct? I took a look at the failures: == ERROR: test_add_file_after_2107

[issue40374] collections.abc docs table: Mapping missing __reversed__

2020-04-23 Thread Dennis Sweeney
Dennis Sweeney added the comment: > `Mapping.__reversed__` exists While ``'__reversed__' in dir(Mapping)`` is true, that unfortunately does not mean that it is a real callable method: from collections.abc import Mapping class Map(Mapping): def __getitem__(self

[issue39939] PEP 616: Add str.removeprefix and str.removesuffix methods

2020-04-22 Thread Dennis Sweeney
Dennis Sweeney added the comment: There's a failure here: https://buildbot.python.org/all/#/builders/64/builds/656 Failed subtests: test_killed_child - test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest Traceback (most recent call last

[issue39939] PEP 616: Add str methods to remove prefix or suffix

2020-04-21 Thread Dennis Sweeney
Dennis Sweeney added the comment: Oops -- I now see the message on Python-Dev. -- ___ Python tracker <https://bugs.python.org/issue39939> ___ ___ Python-bug

[issue39939] PEP 616: Add str methods to remove prefix or suffix

2020-04-21 Thread Dennis Sweeney
Dennis Sweeney added the comment: I'm personally -0 for underscores -- they might slightly improve readability of the function name in isolation but may also add confusion about which methods have underscores. Only one out of the 45 non-dunder str methods has an underscore right now

[issue40313] bytes.hex(sep, bytes_per_sep) is many times slower than manually inserting the separators

2020-04-19 Thread Dennis Sweeney
Dennis Sweeney added the comment: == Master == .\python.bat -m pyperf timeit -s "import random, math; data=random.getrandbits(8*10_000_000).to_bytes(10_000_000, 'big')" "temp = data.hex(); '\n'.join(temp[n:n+128] for n in range(0, len(temp), 128))" Mean

[issue40313] bytes.hex(sep, bytes_per_sep) is many times slower than manually inserting the separators

2020-04-19 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +18930 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19594 ___ Python tracker <https://bugs.python.org/issu

[issue40313] bytes.hex(sep, bytes_per_sep) is many times slower than manually inserting the separators

2020-04-19 Thread Dennis Sweeney
Dennis Sweeney added the comment: I replicated this behavior. This looks like the relevant loop in pystrhex.c: for (i=j=0; i < arglen; ++i) { assert((j + 1) < resultlen); unsigned char c; c = (argbuf[i] >> 4) & 0x0f; retbuf[j++] = Py_hexdigi

[issue40308] Intermittent failure of test_os.TestScandir.test_attributes on Windows

2020-04-18 Thread Dennis Sweeney
Change by Dennis Sweeney : -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue40308] Intermittent failure of test_os.TestScandir.test_attributes on Windows

2020-04-17 Thread Dennis Sweeney
Dennis Sweeney added the comment: I disabled indexing and antivirus and I didn't see anything else obvious that would access the files, but I'm probably missing something -- I get the same intermittent failure when I build from the source at the 3.8.2 release, but not on a copy of 3.8.2

[issue40308] Intermittent failure of test_os.TestScandir.test_attributes on Windows

2020-04-16 Thread Dennis Sweeney
New submission from Dennis Sweeney : I get the following intermittent failure when running the tests on Master on Windows 10. = = = PS C:\...\cpython> .\python.bat -m unittest

[issue40259] re.Scanner groups

2020-04-12 Thread Dennis Chronopoulos
Change by Dennis Chronopoulos : Added file: https://bugs.python.org/file49049/re.Scanner.txt ___ Python tracker <https://bugs.python.org/issue40259> ___ ___ Python-bug

[issue40259] re.Scanner groups

2020-04-12 Thread Dennis Chronopoulos
Change by Dennis Chronopoulos : -- components: Regular Expressions nosy: dchron, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: re.Scanner groups type: behavior versions: Python 3.8 ___ Python tracker <ht

[issue40230] Itertools.product() Out of Memory Errors

2020-04-08 Thread Dennis Sweeney
Change by Dennis Sweeney : -- versions: +Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue40230> ___ ___ Python-bugs-list mailin

[issue40230] Itertools.product() Out of Memory Errors

2020-04-08 Thread Dennis Sweeney
Dennis Sweeney added the comment: The trouble is that itertools.product accepts iterators, and there is no guaranteed way of "restarting" an arbitrary iterator in Python. Consider: >>> a = iter([1,2,3]) >>> b = iter([4,5,6]) >>> next(a)

[issue40085] Argument parsing option c should accept int between -128 to 255 ?

2020-04-05 Thread Dennis Sweeney
Dennis Sweeney added the comment: I think this question is about types in c, apart from any Python c API. According to https://docs.python.org/3/c-api/arg.html#numbers, the specifier is c: (bytes or bytearray of length 1) -> [char] so you should be able to write to a c variable of t

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: Just posted it. -- ___ Python tracker <https://bugs.python.org/issue39939> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: https://github.com/python/peps/pull/1332 -- ___ Python tracker <https://bugs.python.org/issue39939> ___ ___ Python-bugs-list m

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-19 Thread Dennis Sweeney
Change by Dennis Sweeney : Added file: https://bugs.python.org/file48989/pep-.rst ___ Python tracker <https://bugs.python.org/issue39939> ___ ___ Python-bugs-list m

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-19 Thread Dennis Sweeney
Change by Dennis Sweeney : Removed file: https://bugs.python.org/file48983/pep-.rst ___ Python tracker <https://bugs.python.org/issue39939> ___ ___ Python-bugs-list m

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-19 Thread Dennis Sweeney
Dennis Sweeney added the comment: Here is a draft PEP -- I believe it needs a Core Developer sponsor now? -- Added file: https://bugs.python.org/file48983/pep-.rst ___ Python tracker <https://bugs.python.org/issue39

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-18 Thread Dennis Sweeney
Dennis Sweeney added the comment: If no one has started, I can draft such a PEP. -- ___ Python tracker <https://bugs.python.org/issue39939> ___ ___ Python-bug

[issue38938] Possible performance improvement for heaqq.merge()

2020-03-15 Thread Dennis Sweeney
Dennis Sweeney added the comment: My suspicion was confirmed about PyPy (My PyPy here is Python 3.6.1 (784b254d6699, Apr 16 2019, 12:10:48) [PyPy 7.1.1-beta0 with MSC v.1910 32 bit] on win32). In what follows, "heapq2.py" had exactly the `class merge` Python implementation fro

[issue38938] Possible performance improvement for heaqq.merge()

2020-03-14 Thread Dennis Sweeney
Dennis Sweeney added the comment: The existing Python implementation is benefiting from the C accelerators for heapify and heapreplace. When forcing pure python using test.support, I get these results: .\python.bat -m pyperf timeit -s "from random import random; from collections i

[issue38938] Possible performance improvement for heaqq.merge()

2020-03-14 Thread Dennis Sweeney
Dennis Sweeney added the comment: First, as I posted at https://github.com/python/cpython/pull/17729#issuecomment-571864662, there is a theoretical advantage of fewer comparisons in all cases, and the new algorithm would be especially dominant when one iterable keeps winning. (I'm given

<    1   2   3   4   5   6   >