[issue44370] Inconsistent results for min() and max() with math.nan as argument

2021-06-09 Thread Dennis Sweeney
Dennis Sweeney added the comment: This is essentially the same issue, but with sorted(): https://bugs.python.org/issue36095 The trouble is that the implementation of min() is roughly equivalent to: iterable = iter(iterable) current_min = next(iterable) for x in iterable: if x

[issue44370] Inconsistent results for min() and max() with math.nan as argument

2021-06-09 Thread Dennis Sweeney
Dennis Sweeney added the comment: implantation --> implementation -- ___ Python tracker <https://bugs.python.org/issue44370> ___ ___ Python-bugs-list mai

[issue44397] Add Linked Linked module

2021-06-11 Thread Dennis Sweeney
Dennis Sweeney added the comment: This issue is probably a duplicate of https://bugs.python.org/issue42575 . In almost all use cases, a linked list can be replaced by a collections.deque, which already uses a double linked list of blocks internally. Is there something you need a linked list

[issue44283] Add jump table for certain safe match-case statements

2021-06-12 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +25282 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26697 ___ Python tracker <https://bugs.python.org/issu

[issue44283] Add jump table for certain safe match-case statements

2021-06-12 Thread Dennis Sweeney
Dennis Sweeney added the comment: Here are some benchmarks: PS C:\Users\sween\Source\Repos\cpython2\cpython> .\python.bat -m pyperf compare_to .\main.json .\PR-26697.json Running Release|x64 interpreter... 1: Mean +- std dev: [main] 117 us +- 4 us -> [PR-26697] 122 us +- 3 us: 1.04x

[issue44513] for string methods strip, lstrip, rstrip, when param is a string which has more than one char, those methods is no useful currently

2021-06-25 Thread Dennis Sweeney
Dennis Sweeney added the comment: This is the intended behavior. Use s.removeprefix() and s.removesuffix() instead. -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.org/issue44

[issue44521] str.removeprefix(): add strict: bool

2021-06-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: I'm +-0 on this. I would write something like this instead: assert whatever.startswith(prefix) result = whatever.removeprefix(prefix) Note that if this were to change, the corresponding methods would also have to change on bytes, bytearray

[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-02 Thread Dennis Sweeney
Dennis Sweeney added the comment: For what it's worth, using collections.OrderedDict gives constant-time behavior you're looking for. -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.o

[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-03 Thread Dennis Sweeney
Dennis Sweeney added the comment: > Can https://bugs.python.org/issue32623 be a fix (or mitigation) of this issue? If such a change is implemented and dictionaries shrink when their fill falls below 1/8, the behavior of `while d: del d[next(iter(d))]` will remain quadradic: there will

[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-03 Thread Dennis Sweeney
Dennis Sweeney added the comment: Alternate idea: the dict could shrink, if required, on the iter() call, whenever a keys/values/items iterator is initialized. -- ___ Python tracker <https://bugs.python.org/issue44

[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-03 Thread Dennis Sweeney
Dennis Sweeney added the comment: OrderedDict already uses a linked list alongside a dictionary and meets all of your timing expectations, but has a higher memory usage, as linked lists generally do. Since so many Python objects use dictionaries under the hood, it would probably not be

[issue41972] bytes.find consistently hangs in a particular scenario

2021-07-11 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +25639 pull_request: https://github.com/python/cpython/pull/27091 ___ Python tracker <https://bugs.python.org/issue41

[issue41972] bytes.find consistently hangs in a particular scenario

2021-07-11 Thread Dennis Sweeney
Dennis Sweeney added the comment: In "Fast String Searching" (1991), A. Hume and D. Sunday emphasize that most of the runtime of string-search algorithms occurs in a code path that skips over immediately-disqualified alignments. As such, that paper recommends extracting a hot

[issue44605] functools.total_ordering doesn't work with metaclasses

2021-07-12 Thread Dennis Sweeney
Dennis Sweeney added the comment: The one twist is that if type(b) is a strict subtype of type(a), then "a < b" first calls type(b).__gt__(b, a), then falls back to type(a).__lt__(a, b). Example: >>> class Int(int): ... def __gt__(self, other): .

[issue44617] Undesired Behavior on `match` using Singleton object

2021-07-12 Thread Dennis Sweeney
Dennis Sweeney added the comment: This code... match my_maybe: case Maybe.empty: print('FIRST CASE') case _: print('DEFAULT CASE') ... is roughly equivalent to this code: if my_maybe == Maybe.empty: print(&#

[issue44617] Undesired Behavior on `match` using Singleton object

2021-07-13 Thread Dennis Sweeney
Dennis Sweeney added the comment: >From https://www.python.org/dev/peps/pep-0635/#value-patterns : """We therefore only adopted the rule that any dotted name (i.e., attribute access) is to be interpreted as a value pattern, for example HttpStatus.OK above. This preclu

[issue44670] bug on showing tuple on console

2021-07-18 Thread Dennis Sweeney
Dennis Sweeney added the comment: I don't know what behavior you were expecting, but *args means "the rest of the positional arguments", not "all of the positional arguments." See https://docs.python.org/3/tutorial/controlflow.html?highlight=variadic

[issue44669] TypeError: 'type' object is not subscriptable

2021-07-19 Thread Dennis Sweeney
Dennis Sweeney added the comment: > While attempting to run an application How are you starting this application? It looks like you're using Python 3.9 standard library files (like _collections_abc.py in the traceback you posted), but is it possible that you're accidentally run

[issue44683] String formatting

2021-07-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: If I understand correctly, this shows the behavior you're objecting to: >>> class A: ... def __getitem__(self, key): ... print(f"{key = }") ... return "apple" ... ... >>> '{0[1]}

[issue44683] Can't subscript objects with the string "1" using str.format()

2021-07-20 Thread Dennis Sweeney
Change by Dennis Sweeney : -- title: String formatting -> Can't subscript objects with the string "1" using str.format() ___ Python tracker <https://bugs.

[issue44704] frozenset.__hash__ vs. Set._hash

2021-07-21 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch nosy: +Dennis Sweeney nosy_count: 1.0 -> 2.0 pull_requests: +25825 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27281 ___ Python tracker <https://bugs.p

[issue44704] frozenset.__hash__ vs. Set._hash

2021-07-21 Thread Dennis Sweeney
Dennis Sweeney added the comment: I opened a PR. It looks like frozenset.__hash__ changed in GH-5194 and GH-5235, but Set._hash wasn't updated accordingly. -- ___ Python tracker <https://bugs.python.org/is

[issue44719] Incorrect callable object crashes Python 3.11.0a0

2021-07-23 Thread Dennis Sweeney
Dennis Sweeney added the comment: ### Simplified crasher from weakref import ref def f(): ref(lambda: 0, []) f() f() Running this in debug mode, I got a failed assertion at traceback.c, line 746, `assert(source_line);`. If that assertion is commented out

[issue43950] Include column offsets for bytecode instructions

2021-07-23 Thread Dennis Sweeney
Dennis Sweeney added the comment: bpo-44719 managed to make the `assert(source_line);` fail -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.org/issue43

[issue44720] Finding string in iteratively deleted object cause segfault

2021-07-23 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch nosy: +Dennis Sweeney nosy_count: 1.0 -> 2.0 pull_requests: +25862 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27316 ___ Python tracker <https://bugs.p

[issue44720] Weakref proxy crashes on null tp_iternext slot.

2021-07-23 Thread Dennis Sweeney
Dennis Sweeney added the comment: Here's a simpler reproducer: not_an_iterator = lambda: 0 class A: def __iter__(self): return weakref.proxy(not_an_iterator) a = A() list(a) I opened a PR. -- title: Finding stri

[issue44719] Incorrect callable object crashes Python 3.11.0a0

2021-07-23 Thread Dennis Sweeney
Dennis Sweeney added the comment: I think GH-27313 will fix this -- ___ Python tracker <https://bugs.python.org/issue44719> ___ ___ Python-bugs-list mailin

[issue44719] Incorrect callable object crashes Python 3.11.0a0

2021-07-26 Thread Dennis Sweeney
Dennis Sweeney added the comment: Indeed, I got no crash on main after GH-27313. I also got no crash on 3.10 after GH-23568. Its backport to 3.9 (GH-24501) would have fixed this, but broke the stable ABI and was reverted. This was related to bpo-42500. I'm closing this "fixed&q

[issue44745] Manual for python 3.9.6 will not let me search

2021-07-26 Thread Dennis Sweeney
Dennis Sweeney added the comment: I replicated the issue: downloading the "Windows Help File" (python396.chm) from the release page https://www.python.org/downloads/release/python-396/ , opening it, and entering a search term (e.g., "tuple") into the search tab resulted

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

2021-07-26 Thread Dennis Sweeney
Change by Dennis Sweeney : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44754] Documentation for pop in Built-in Types

2021-07-27 Thread Dennis Sweeney
Dennis Sweeney added the comment: The [square brackets] are used to denote *optional* arguments throughout the documentation. A tutorial page (https://docs.python.org/3/tutorial/controlflow.html#id1) has this to say: list.pop([i]) Remove the item at the given position in the list

[issue44754] Documentation for pop in Built-in Types

2021-07-27 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +25931 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27398 ___ Python tracker <https://bugs.python.org/issu

[issue44755] cpython Lib bisect.py overflow (lo + hi) // 2 a problem?

2021-07-27 Thread Dennis Sweeney
Dennis Sweeney added the comment: This is a good idea for languages where integers are bounded, but in Python, integers can be as large as you want, so there's no reason to worry about overflow: >>> lo = 1 * 10**100 >>> hi = 2 * 10*

[issue44755] cpython Lib bisect.py overflow (lo + hi) // 2 a problem?

2021-07-27 Thread Dennis Sweeney
Dennis Sweeney added the comment: Thanks for the concern, but I'll close this as "not a bug". Feel free to re-open if you can give an example where the current code fails. -- resolution: -> not a bug stage: -> resolved s

[issue42167] Documentation for SETUP_WITH opcode is wrong

2021-07-27 Thread Dennis Sweeney
Dennis Sweeney added the comment: Opcodes change from one version to another. You linked the Python 3.9 documentation. Python 3.9 opcodes are listed here: https://github.com/python/cpython/blob/3.9/Lib/opcode.py (and you can browse the branches and commit history for that file). 3.9 has

[issue42167] Documentation for SETUP_WITH opcode is wrong

2021-07-27 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +25935 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27402 ___ Python tracker <https://bugs.python.org/issu

[issue42167] Documentation for SETUP_WITH opcode is wrong

2021-07-27 Thread Dennis Sweeney
Dennis Sweeney added the comment: GH-24334 already applied the necessary change for 3.10. -- nosy: +iritkatriel ___ Python tracker <https://bugs.python.org/issue42

[issue44770] float('nan') is True

2021-07-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: Do you have a particular use case for this? This is a backwards-incompatible change, and the existing behavior (the only false-y float being 0.0) is very old and well-established. If this change was implemented, I suspect almost every use of it would

[issue44782] LRU class given as example in OrderedDict docs not work on pop

2021-07-30 Thread Dennis Sweeney
Dennis Sweeney added the comment: Related (regarding od.popitem()): https://bugs.python.org/issue27275 -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.org/issue44

[issue44789] Code compliance concern in Parser/pegen/pegen.c

2021-07-30 Thread Dennis Sweeney
Dennis Sweeney added the comment: To be specific, is this about the fact that .arg is a member of `struct _arg` (typedef'ed as `arg_ty`), while at the same time arg() is a macro? as in: https://github.com/python/cpython/blob/0f42b726c87f72d522893f927b4cb592b8875641/Parser/pegen/pegen.

[issue44790] Recursion causes Crash

2021-07-30 Thread Dennis Sweeney
Dennis Sweeney added the comment: Indeed, this behavior is documented at https://docs.python.org/3/library/sys.html?highlight=setrecursionlimit#sys.setrecursionlimit : "a too-high limit can lead to a crash". I'd recommend refactoring to use iteration rather than recursion:

[issue42026] index function return first index for same element if repetitive in a list

2021-07-30 Thread Dennis Sweeney
Change by Dennis Sweeney : -- status: open -> closed ___ Python tracker <https://bugs.python.org/issue42026> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-07-30 Thread Dennis Sweeney
Dennis Sweeney added the comment: bpo-44782 was opened about the `class LRU(OrderedDict)` in the OrderedDict docs, and its pop() method failing. I think Serhiy's patch here (before revert) may be a good idea (to re-apply). I think it is reasonable to ignore user-implemented dunder me

[issue44814] python 3.9.6 installation installs 0 modules

2021-08-02 Thread Dennis Sweeney
Dennis Sweeney added the comment: Are you still able to `import heapq` or `import sys`? `requests` and `filetype` are not part of the Python standard library, and must be installed separately. You can check out the tutorial here: https://packaging.python.org/tutorials/installing-packages

[issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread

2021-08-02 Thread Dennis Sweeney
Dennis Sweeney added the comment: It was mentioned in bpo-40327 that although copy() makes the situation much better, it doesn't solve the problem entirely, since the memory allocation of the copy() call can release the GIL. I don't know enough to know whether it would be worth

[issue44850] Could operator.methodcaller be optimized using LOAD_METHOD?

2021-08-07 Thread Dennis Sweeney
Dennis Sweeney added the comment: Using _PyObject_GetMethod similarly to the way that LOAD_METHOD/CALL_METHOD does seems like a reasonable idea to me -- do you want to make a pull request? It would also be nice to see some microbenchmarks for the change once it's ready. --

[issue44850] Could operator.methodcaller be optimized using LOAD_METHOD?

2021-08-07 Thread Dennis Sweeney
Dennis Sweeney added the comment: For what it's worth, in my benchmarks on 3.11, methodcaller was already a bit faster than lambda: Builtin calls PS > .\python.bat -m pyperf timeit -s "from operator import methodcaller as mc" -

[issue44866] Inconsistent Behavior of int()

2021-08-08 Thread Dennis Sweeney
Dennis Sweeney added the comment: You typed `int_y = int(2.8)`, so you passed the floating point number 2.8, which the int() function rounds down to 2. On the other hand when y had the string value '2.8'. The int(y) call tried to parse an integer out of the string, but failed s

[issue43585] perf_counter() returns computers uptime

2021-08-08 Thread Dennis Sweeney
Change by Dennis Sweeney : -- resolution: -> not a bug stage: -> resolved status: pending -> closed ___ Python tracker <https://bugs.python.or

[issue44891] Tests for `id(a) == id(a * 1)` for `bytes` and `str`

2021-08-12 Thread Dennis Sweeney
Dennis Sweeney added the comment: Perhaps it would be better to convert existing such tests to @cpython_only, since as far as I know, id() and `is` are implementation-defined for immutable objects. -- nosy: +Dennis Sweeney ___ Python tracker

[issue44950] Math

2021-08-18 Thread Dennis Sweeney
Dennis Sweeney added the comment: This is not a bug, see the tutorial page here: https://docs.python.org/3.9/tutorial/floatingpoint.html Also, in the future, it's best to report bugs by thoroughly describing the actual/expected behavior in text and copy/pasting code, rather than

[issue44953] Add vectorcall on operator.itemgetter and attrgetter objects

2021-08-19 Thread Dennis Sweeney
New submission from Dennis Sweeney : ## Below are my benchmarks for this change. from operator import itemgetter, attrgetter from pyperf import Runner class MyClass: __slots__ = "a", "b" namespace = {'itemgetter': itemgetter, 'attrgetter&

[issue44953] Add vectorcall on operator.itemgetter and attrgetter objects

2021-08-19 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +26293 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27828 ___ Python tracker <https://bugs.python.org/issu

[issue42085] Add dedicated slot for sending values

2021-08-21 Thread Dennis Sweeney
Dennis Sweeney added the comment: Is there documentation anywhere for the semantics of am_send? I only see the signature followed by "See PyIter_Send for details", but the doc for PyIter_Send doesn't mention am_send. In particular, it would be nice to document the relat

[issue42085] Add dedicated slot for sending values

2021-08-25 Thread Dennis Sweeney
Dennis Sweeney added the comment: It did get added to the correct docs: https://docs.python.org/3.10/c-api/typeobj.html#c.PyAsyncMethods.am_send (the 3.10 and 3.11 docs, not the 3.9 docs ;-) But as I mentioned, I feel that there could be more details about the semantics/contract

[issue45026] More compact range iterator

2021-08-26 Thread Dennis Sweeney
Dennis Sweeney added the comment: Is it worth removing the len field as well and lazily using get_len_of_range() as needed? Then the hot function can look something like: static PyObject * rangeiter_next(rangeiterobject *r) { long result = r->start if (result < r->stop) {

[issue45117] `dict` not subscriptable despite using `__future__` typing annotations

2021-09-06 Thread Dennis Sweeney
Dennis Sweeney added the comment: Hi Stefan, `from __future__ import annotations` only affects annotations -- just the things after the colon. It makes it so that annotations are never evaluated, so things like this work: >>> from __future__ import annotations >&g

[issue45026] More compact range iterator

2021-09-22 Thread Dennis Sweeney
Dennis Sweeney added the comment: I benchmarked GH-27986 and GH-28176 on "for i in range(1): pass" and found that GH-27986 was faster for this (likely most common) case of relatively small integers. Mean +- std dev: [main] 204 us +- 5 us -> [GH-27986] 194 us +- 4 us: 1.05x

[issue45268] use multiple "in" in one expression?

2021-09-22 Thread Dennis Sweeney
Dennis Sweeney added the comment: This is the expected behavior, documented here: https://docs.python.org/3/reference/expressions.html#comparisons That page says: * The comparison operators are "<" | ">" | "==" | ">=" | "<="

[issue45026] More compact range iterator

2021-09-25 Thread Dennis Sweeney
Dennis Sweeney added the comment: I did more benchmarks on my Windows laptop, and it seems the difference goes away after using PGO. The benchmarking program: # from pyperf import Runner runner = Runner() for n in [10, 100, 1000, 10_000, 100_000

[issue41223] `object`-backed `memoryview`'s `tolist` errors

2021-09-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: Can you describe your use-case more? In particular, why use memoryview(a).tolist() instead of a.tolist()? Or some other numpy operations like a.flat or a.view()? Or even numpy.array(memoryview(a)) to recover a numpy array from a memoryview? If this were

[issue45338] Add key argument to collections.Counter

2021-10-01 Thread Dennis Sweeney
Dennis Sweeney added the comment: How is Counter(numbers, key=abs) any better than Counter(map(abs, numbers))? It seems to me that "apply a function to each thing" (map) and "count the numbers of each thing" (Counter) are two orthogonal concepts, and there's no

[issue45338] Add key argument to collections.Counter

2021-10-01 Thread Dennis Sweeney
Dennis Sweeney added the comment: The values of a Counter are generally integers, not lists. Maybe you want: items_by_keyfunc = defaultdict(list) for x in all_the_items: items_by_keyfunc[keyfunc(x)].append(x) Then items_by_keyfunc[42] is a list of the things with key 42

[issue45348] math.log(243, 3) value issue

2021-10-02 Thread Dennis Sweeney
Dennis Sweeney added the comment: According to https://docs.python.org/3/library/math.html#math.log : """With two arguments, return the logarithm of x to the given base, calculated as log(x)/log(base).""" Indeed, this is consistent with that: >&g

[issue45348] math.log(243, 3) value issue

2021-10-02 Thread Dennis Sweeney
Dennis Sweeney added the comment: It turns out that the current implementation is already very good, within 1ulp in 99.85% of cases and perfect (as good as floats can get) in 65% of cases. So my thinking would be to leave the implementation as is

[issue45348] math.log(243, 3) value issue

2021-10-02 Thread Dennis Sweeney
Change by Dennis Sweeney : -- nosy: +mark.dickinson, rhettinger ___ Python tracker <https://bugs.python.org/issue45348> ___ ___ Python-bugs-list mailin

[issue45353] sys.modules: dictionary changed size during iteration

2021-10-03 Thread Dennis Sweeney
Dennis Sweeney added the comment: One standard way of preventing this is copying the dictionary whenever there's risk of it changing out from under you, as in: modules = sys.modules.copy() for key, value in modules.items(): ... -- nosy: +Dennis Sw

[issue45367] Specialize BINARY_MULTIPLY

2021-10-04 Thread Dennis Sweeney
New submission from Dennis Sweeney : I'm having trouble setting up a rigorous benchmark (Windows doesn't want to install greenlet for pyperformance), but just running a couple of individual files, I got this: Mean +- std dev: [nbody_main] 208 ms +- 2 ms -> [nbody_specialized] 18

[issue45367] Specialize BINARY_MULTIPLY

2021-10-04 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +27074 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28727 ___ Python tracker <https://bugs.python.org/issu

[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2021-10-04 Thread Dennis Sweeney
Change by Dennis Sweeney : -- nosy: +Dennis Sweeney nosy_count: 8.0 -> 9.0 pull_requests: +27076 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28727 ___ Python tracker <https://bugs.python.org/i

[issue45367] Specialize BINARY_MULTIPLY

2021-10-05 Thread Dennis Sweeney
Dennis Sweeney added the comment: Hm the above was not PGO. I tried again with PGO and it is not so good: Mean +- std dev: [nbody_main_pgo] 177 ms +- 4 ms -> [nbody_specialized_pgo] 190 ms +- 2 ms: 1.07x slower Mean +- std dev: [pidigits_main_pgo] 208 ms +- 1 ms -> [pidigits_specializ

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

2021-10-06 Thread Dennis Sweeney
Change by Dennis Sweeney : -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2021-10-06 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: -27076 ___ Python tracker <https://bugs.python.org/issue41682> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45443] 'ThreadPoolExecutor' object has no attribute 'map'

2021-10-14 Thread Dennis Sweeney
Dennis Sweeney added the comment: I was also unable to replicate on any of 3.7-3.11, including 3.9.6. Is it possible that one of your Python stdlib source files was modified? Does this still happen with a fresh install of Python? Does your problem still happen if you run the file using a

[issue45443] 'ThreadPoolExecutor' object has no attribute 'map'

2021-10-14 Thread Dennis Sweeney
Change by Dennis Sweeney : -- components: +Library (Lib) status: open -> pending type: crash -> behavior ___ Python tracker <https://bugs.python.org/i

[issue45367] Specialize BINARY_MULTIPLY

2021-10-17 Thread Dennis Sweeney
Change by Dennis Sweeney : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-18 Thread Dennis Sweeney
Dennis Sweeney added the comment: Oh yeah -- Py_EnterRecursiveCall/Py_LeaveRecursiveCall in abstract_get_bases would be simpler. Also, the set approach also probably still c-stack overflows on class C: def __getattr__(self, attr): class A: pass class B: pass A

[issue45508] Specialize INPLACE_ADD

2021-10-18 Thread Dennis Sweeney
New submission from Dennis Sweeney : I ran on WSL with PGO and got "1.00x faster": https://gist.github.com/sweeneyde/41a76356e875e2a98d16ce5410ab41c0 My benchmarking doesn't seem particularly reliable, so someone else should probably verify. Great specialization stats, e

[issue45508] Specialize INPLACE_ADD

2021-10-18 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +27297 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29024 ___ Python tracker <https://bugs.python.org/issu

[issue34192] FunctionType.__new__ can generate functions that immediately crash

2021-10-18 Thread Dennis Sweeney
Dennis Sweeney added the comment: >From >https://github.com/python/cpython/blob/main/Lib/test/crashers/bogus_code_obj.py > : """ Broken bytecode objects can easily crash the interpreter. This is not going to be fixed. It is generally agreed that there is no poi

[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-18 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +27319 pull_request: https://github.com/python/cpython/pull/29048 ___ Python tracker <https://bugs.python.org/issue30

[issue45542] Using multiple comparison operators can cause performance issues

2021-10-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: The PR changes behavior slightly: def f(): class A: def __lt__(self, other): nonlocal x x += 100 return True a = A() x = 1 print(a < x < 10) x = 1 print(a < x and x < 10)

[issue45586] Use starred expressions in subscripts

2021-10-23 Thread Dennis Sweeney
Dennis Sweeney added the comment: Jacob wrote: a[[0, *[0, 0], 0]] which passes the *list* [0, 0, 0, 0] into __getitem__. In numpy, passing lists into __getitem__ does things like array([1, 10, 100])[[2, 1]] --> array([100, 10]). But I think Peter is requesting that the following w

[issue45609] Specialize STORE_SUBSCR

2021-10-25 Thread Dennis Sweeney
New submission from Dennis Sweeney : See the issue here for lots of data from before specializing: https://github.com/faster-cpython/ideas/issues/105 See https://gist.github.com/sweeneyde/91855e50feb9992b604ddda2d4f1511e for specialization data, pyperformance benchmarks, and microbenchmarks

[issue45609] Specialize STORE_SUBSCR

2021-10-25 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +27484 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29221 ___ Python tracker <https://bugs.python.org/issu

[issue45586] Use starred expressions in subscripts

2021-10-26 Thread Dennis Sweeney
Dennis Sweeney added the comment: Yes, I don't believe the PEP is suggesting any changes to list.__getitem__. If you want to suggest such enhancements, I would suggest first sending a message to the python-ideas mailing list or on discuss.pytho

[issue45620] A misleading url in 'Floating Point Arithmetic' page

2021-10-27 Thread Dennis Sweeney
Dennis Sweeney added the comment: I was unable to replicate this. I see the correct article "The Perils of Floating Point" at lahey.com/float.htm. Is the site still incorrect for you, or did the Lahey site fix the issue? -- assignee: -> docs@python components: +Docum

[issue45609] Specialize STORE_SUBSCR

2021-10-27 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +27505 pull_request: https://github.com/python/cpython/pull/29242 ___ Python tracker <https://bugs.python.org/issue45

[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-27 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +27522 pull_request: https://github.com/python/cpython/pull/29258 ___ Python tracker <https://bugs.python.org/issue30

[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-27 Thread Dennis Sweeney
Dennis Sweeney added the comment: I think this broke some buildbots. https://buildbot.python.org/all/#/builders/256/builds/264 https://buildbot.python.org/all/#/builders/370/builds/263 I opened a PR to temporarily decrease the recursion limit so that the C stack doesn't overflow in

[issue45484] test_pickle segfault on s390x RHEL7 LTO 3.x

2021-10-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: Hopefully this was fixed by https://github.com/python/cpython/pull/29258 -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.org/issue45

[issue45443] 'ThreadPoolExecutor' object has no attribute 'map'

2021-10-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: It's been a couple of weeks, so I'm closing this. Feel free to re-open if you figure out that this is a bug that you can reliably reproduce on a fresh install of cpython. -- resolution: -> not a bug stage: -> resolved status: p

[issue45646] Star expression in comprehension wrongly indicates to use or_expression after the star

2021-10-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: Hi Arthur, I agree that the line about "name ::= othername" could be more helpful. I think an affirmative example would be better than a warning against depending on variable names, because the top of the page mentions that BNF is being used an

[issue45484] test_pickle segfault on s390x RHEL7 LTO 3.x

2021-10-29 Thread Dennis Sweeney
Dennis Sweeney added the comment: Looks like the pickletester bug hasn't happened since the fix, so I'll go ahead and close this. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <h

[issue45646] Star expression in comprehension wrongly indicates to use or_expression after the star

2021-11-02 Thread Dennis Sweeney
Dennis Sweeney added the comment: Feel free to use anything I wrote in a PR and make any revisions/edits you want. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45697] PyType_IsSubtype is doing excessive work in the common case

2021-11-02 Thread Dennis Sweeney
Dennis Sweeney added the comment: Interesting. It seems like several call sites already check the equality case: setobject.h: #define PyFrozenSet_Check(ob) \ (Py_IS_TYPE(ob, &PyFrozenSet_Type) || \ PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))

[issue45707] Variable reassginment triggers incorrect behaviors of locals()

2021-11-03 Thread Dennis Sweeney
Dennis Sweeney added the comment: >From https://docs.python.org/3/library/functions.html#exec : "modifications to the default locals dictionary should not be attempted. Pass an explicit locals dictionary if you need to see effects of the code on locals after function exec() returns.

[issue45715] round(2500, -3)

2021-11-04 Thread Dennis Sweeney
Dennis Sweeney added the comment: Thanks for the report, but this is the intended behavior. >From https://docs.python.org/3/library/functions.html#round : """values are rounded to the closest multiple of 10 to the power minus ndigits; if two multiples are equally close

[issue45745] ./python -m test --help output for refleaks seems wrong

2021-11-07 Thread Dennis Sweeney
Dennis Sweeney added the comment: IIUC you're looking for --huntrleaks/-R, not the unrelated --findleaks/-l: In that -m test -h menu: -l, --findleaks deprecated alias to --fail-env-changed -R RUNCOUNTS, --huntrleaks RUNCOUNTS search for reference

[issue45806] Cannot Recover From StackOverflow in 3.9 Tests

2021-11-14 Thread Dennis Sweeney
New submission from Dennis Sweeney : In bpo-30570, David Bolen noticed that "py -3.9 -m test test_pickle" consistently crashes on Windows (even though other methods of running that test do not crash, and the test succeeds when failed tests are retried). Curiously, it seems that ad

<    1   2   3   4   5   6   >