[issue47248] Possible slowdown of regex searching in 3.11

2022-04-08 Thread Dennis Sweeney
Dennis Sweeney added the comment: Possibly related to the new atomic grouping support from GH-31982? -- nosy: +Dennis Sweeney, serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue47

[issue47009] Streamline list.append for the common case

2022-04-05 Thread Dennis Sweeney
Dennis Sweeney added the comment: Buildbots are passing, so I'm closing this. Thanks for the catch and fix! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue47226] if we write a line of code like i wrote keys = pygame.key.get_pressed() is showing error

2022-04-04 Thread Dennis Sweeney
New submission from Dennis Sweeney : What error message? -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.org/issue47226> ___ ___ Python-bug

[issue45542] Using multiple comparison operators can cause performance issues

2022-04-04 Thread Dennis Sweeney
Dennis Sweeney added the comment: For reference, chaining is about 1.18x slower in this microbenchmark on GCC: ./python -m pyperf timeit -s "x = 100" "if 10 < x < 30: print('no')" --duplicate=10 . Mean +- std dev: 21.3 ns +- 0.2 ns ./python -m

[issue45542] Using multiple comparison operators can cause performance issues

2022-04-04 Thread Dennis Sweeney
Dennis Sweeney added the comment: https://bugs.python.org/issue47221 was opened as a duplicate of this. Unless there are any new ideas for getting around the concerns here, I think this can be closed. -- status: open -> pending ___ Python trac

[issue47221] chained comparisons slower than using `and`

2022-04-04 Thread Dennis Sweeney
Dennis Sweeney added the comment: Feel free to comment on that issue if you have any ideas about how to address the concerns there. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Using multiple comparison operators can cause perfor

[issue47221] chained comparisons slower than using `and`

2022-04-04 Thread Dennis Sweeney
Change by Dennis Sweeney : -- title: Bug or bad performance -> chained comparisons slower than using `and` ___ Python tracker <https://bugs.python.org/issu

[issue47221] Bug or bad performance

2022-04-04 Thread Dennis Sweeney
Dennis Sweeney added the comment: I believe this is a duplicate of this issue: https://bugs.python.org/issue45542 -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.org/issue47

[issue47214] builtin_function_or_method is also either a function or a method

2022-04-04 Thread Dennis Sweeney
Dennis Sweeney added the comment: https://docs.python.org/3/library/inspect.html#inspect.isfunction says this: """ inspect.isfunction(object) Return True if the object is a Python function, which includes functions created by a lambda expression. """ Em

[issue47009] Streamline list.append for the common case

2022-04-01 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +30310 pull_request: https://github.com/python/cpython/pull/32239 ___ Python tracker <https://bugs.python.org/issue47

[issue47145] Improve graphlib.TopologicalSort by removing the prepare step

2022-03-29 Thread Dennis Sweeney
Dennis Sweeney added the comment: > depends on an already-yielded node I mean "creates a new not-yet-yielded dependency for an already-yielded node". -- ___ Python tracker <https://bugs.pytho

[issue47145] Improve graphlib.TopologicalSort by removing the prepare step

2022-03-29 Thread Dennis Sweeney
Dennis Sweeney added the comment: Out of curiosity, what are the use cases for adding nodes after get_ready has already produced nodes? I was wondering about avoiding the need to call prepare() by having it automatically do the cycle-checking at the first get_ready() call and then raising

[issue47157] bijective invertible map

2022-03-29 Thread Dennis Sweeney
Dennis Sweeney added the comment: see also https://bugs.python.org/issue44931 -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.org/issue47

[issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE

2022-03-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset 788154919c2d843a0a995994bf2aed2d074761ec by Dennis Sweeney in branch 'main': bpo-47053: Refactor BINARY_OP_INPLACE_ADD_UNICODE (GH-32122) https://github.com/python/cpython/commit/788154919c2d843a0a995994bf2aed2d074761ec

[issue47070] Improve performance of array_inplace_repeat

2022-03-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset 850687df47b03e98c1433e6e70e71a8921eb4454 by Pieter Eendebak in branch 'main': bpo-47070: Add _PyBytes_Repeat() (GH-31999) https://github.com/python/cpython/commit/850687df47b03e98c1433e6e70e71a8921eb4454

[issue47132] Move tests from setobject.c to _testcapimodule

2022-03-26 Thread Dennis Sweeney
Change by Dennis Sweeney : -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue47132> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue47116] Use _PyLong_FromUnsignedChar in bytearrayobject.c

2022-03-26 Thread Dennis Sweeney
Dennis Sweeney added the comment: Thanks! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue47116] Use _PyLong_FromUnsignedChar in bytearrayobject.c

2022-03-26 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset c23ddf5ec229b7302437a1cf32d366df5cc5b837 by Pieter Eendebak in branch 'main': bpo-47116: use _PyLong_FromUnsignedChar instead of PyLong_FromLong (GH-32110) https://github.com/python/cpython/commit/c23ddf5ec229b7302437a1cf32d366df5cc5b837

[issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE

2022-03-26 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +30202 pull_request: https://github.com/python/cpython/pull/32122 ___ Python tracker <https://bugs.python.org/issue47

[issue47114] random.choice and random.choices have different distributions

2022-03-24 Thread Dennis Sweeney
Dennis Sweeney added the comment: Possible duplicate of https://bugs.python.org/issue44080 -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.org/issue47

[issue47012] Speed up iteration of bytes and bytearray

2022-03-23 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset bd1cf6ecee76bcdce87b4f69567b95756ecf5a4c by Kumar Aditya in branch 'main': bpo-47012: speed up iteration of bytes and bytearray (GH-31867) https://github.com/python/cpython/commit/bd1cf6ecee76bcdce87b4f69567b95756ecf5a4c -- nosy

[issue47094] index doesn't change while looping through same elements in a list

2022-03-22 Thread Dennis Sweeney
Dennis Sweeney added the comment: The help text says this: >>> help(list.index) Help on method_descriptor: index(self, value, start=0, stop=9223372036854775807, /) Return first index of value. Raises ValueError if the value is not present.

[issue47067] Add vectorcall for generica alias object

2022-03-21 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset 1ea055bd53ccf976e88018983a3c13447c4502be by penguin_wwy in branch 'main': bpo-47067: Optimize calling GenericAlias objects (GH-31996) https://github.com/python/cpython/commit/1ea055bd53ccf976e88018983a3c13447c4502be

[issue46712] Share global string identifiers in deepfreeze

2022-03-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: In bpo-47067, there was concern about the addition of the makefile target from PR 31637: regen-global-objects: regen-deepfreeze After a new `&_Py_ID(__orig_class__)` is added to Objects/genericaliasobject.c, running `make regen-global-objects` st

[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: I profiled dict[str, int](a=1, b=2), and it looks like a decent chunk of time comes from PyUnicode_New as used by PyObject_SetAttrString. You could also try replacing PyObject_SetAttrString with PyObject_SetAttr and adding "__orig_class__" to

[issue47070] Improve performance of array_inplace_repeat

2022-03-19 Thread Dennis Sweeney
Dennis Sweeney added the comment: I'd bet we could add a couple of utility functions that could be used in multiple places, to keep the "trick" all in one place. Something like void _PyBytes_RepeatInPlace(char **buffer, size_t start_len, size_t end_len) { // Repeatedly double.

[issue47005] Improve performance of bytes_repeat

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

[issue47005] Improve performance of bytes_repeat

2022-03-17 Thread Dennis Sweeney
Dennis Sweeney added the comment: Thanks for the contribution -- that's a really nice speedup. -- ___ Python tracker <https://bugs.python.org/issue47

[issue47005] Improve performance of bytes_repeat

2022-03-17 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset ac8308d3eaf2526318c1bbf13d4a214fd24605d2 by Pieter Eendebak in branch 'main': bpo-47005: Improve performance of bytearray_repeat and bytearray_irepeat (GH-31856) https://github.com/python/cpython/commit/ac8308d3eaf2526318c1bbf13d4a214fd24605d2

[issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE

2022-03-17 Thread Dennis Sweeney
Change by Dennis Sweeney : -- type: security -> performance ___ Python tracker <https://bugs.python.org/issue47053> ___ ___ Python-bugs-list mailing list Un

[issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE

2022-03-17 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +30058 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31318 ___ Python tracker <https://bugs.python.org/issu

[issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE

2022-03-17 Thread Dennis Sweeney
New submission from Dennis Sweeney : There was a discussion here: https://github.com/faster-cpython/ideas/discussions/269 Checking for whether the assignment target is the left-hand side, rather than just checking for the right refcount, is more stable and reduces the number

[issue47052] allow string as sep in _Py_strhex_impl ( bytearray.hex() )

2022-03-17 Thread Dennis Sweeney
Dennis Sweeney added the comment: In particular, it's one ascii character: >>> b'abracadabra'.hex('') ValueError: sep must be ASCII. I wouldn't be completely opposed to allowing longer strings, but since there are easy enough ways to do it already, put me at a -0. W

[issue47052] allow string as sep in _Py_strhex_impl ( bytearray.hex() )

2022-03-17 Thread Dennis Sweeney
Dennis Sweeney added the comment: Would there be substantial benefit of a new feature over using the existing feature and then calling str.replace()? >>> b = b'abracadabra' >>> "0x" + b.hex(":").replace(":", ", 0x") '0x61,

[issue47037] Build problems on Windows

2022-03-16 Thread Dennis Sweeney
Dennis Sweeney added the comment: indeed, bisected to 2cf7f865f099db11cc6903b334d9c376610313e8 is the first bad commit commit 2cf7f865f099db11cc6903b334d9c376610313e8 Author: Christian Heimes Date: Tue Mar 15 11:41:04 2022 +0200 bpo-46587: Skip tests if strftime does not support glibc

[issue47028] Incorrect behaviour when zipping a bunch of maps

2022-03-15 Thread Dennis Sweeney
Dennis Sweeney added the comment: https://bugs.python.org/issue45469 is similar. Thanks for the report, but I'll go ahead and close this. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracke

[issue47028] Incorrect behaviour when zipping a bunch of maps

2022-03-15 Thread Dennis Sweeney
Dennis Sweeney added the comment: There's an FAQ entry here: https://docs.python.org/3/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result -- ___ Python tracker <https://bugs.python.

[issue47028] Incorrect behaviour when zipping a bunch of maps

2022-03-15 Thread Dennis Sweeney
Dennis Sweeney added the comment: This is because i is not captured by the function definition. `lambda x: x**i` always makes the "input to the ith power" function, never the "input to the 3rd power" function, even if i happens to be 3 right now. Consider repla

[issue47008] Add Lib/site-packages to .gitignore

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

[issue47009] Streamline list.append for the common case

2022-03-14 Thread Dennis Sweeney
Dennis Sweeney added the comment: The attached _PyList_AppendTakeRef.diff has the ceval.c, but this implementation: int _PyList_AppendTakeRef(PyListObject *self, PyObject *newitem) { assert(self != NULL && newitem != NULL); assert(PyList_Check(self)); Py_ssi

[issue47009] Streamline list.append for the common case

2022-03-13 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +29962 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31864 ___ Python tracker <https://bugs.python.org/issu

[issue47009] Streamline list.append for the common case

2022-03-13 Thread Dennis Sweeney
New submission from Dennis Sweeney : list_resize is a long function that probably won't get inlined. But for the vast majority of cases in list.append, we just need to check whether the list is big enough (not whether it's small enough, or whether it's null or the wrong type), then insert

[issue47008] Add Lib/site-packages to .gitignore

2022-03-13 Thread Dennis Sweeney
Dennis Sweeney added the comment: I made a copy/paste error, it should be: Lib/site-packages/* !Lib/site-packages/README.txt -- ___ Python tracker <https://bugs.python.org/issue47

[issue47008] Add Lib/site-packages to .gitignore

2022-03-13 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +29960 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31862 ___ Python tracker <https://bugs.python.org/issu

[issue47008] Add Lib/site-packages to .gitignore

2022-03-13 Thread Dennis Sweeney
New submission from Dennis Sweeney : It would be nice to add the following to .gitignore, so that I can `./python -m pip install [whatever]` without overwhelming the output of `git status`. Lib/site-packages/* !Lib/test/data/README.txt -- messages: 415114 nosy: Dennis Sweeney

[issue46961] Caching/interning of small ints sometimes fails

2022-03-13 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +29942 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31843 ___ Python tracker <https://bugs.python.org/issu

[issue46961] Caching/interning of small ints sometimes fails

2022-03-12 Thread Dennis Sweeney
Dennis Sweeney added the comment: I believe the issue is the usage of the x_divrem function. x_divrem always returns fresh ints, never cached small ints. This behavior is relied upon in the long_true_divide function, as it mutates the returned quotient at the line """x->

[issue46979] Spam

2022-03-10 Thread Dennis Sweeney
Change by Dennis Sweeney : -- components: -Build resolution: -> not a bug stage: -> resolved status: open -> closed title: Master piece -> Spam type: security -> ___ Python tracker <https://bugs.pyt

[issue46896] add support for watching writes to selected dictionaries

2022-03-09 Thread Dennis Sweeney
Dennis Sweeney added the comment: A curiosity: have you considered watching dict keys rather than whole dicts? That way, changing global values would not have to de-optimize, only adding new global keys would. Indexing into dict values array wouldn't be as efficient as embedding direct

[issue39829] __len__ called twice in the list() constructor

2022-03-07 Thread Dennis Sweeney
Dennis Sweeney added the comment: Related to Matt's idea is https://bugs.python.org/issue43574 -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.org/issue39

[issue46952] pip progress bar display bug

2022-03-07 Thread Dennis Sweeney
Change by Dennis Sweeney : -- resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46952] pip progress bar display bug

2022-03-07 Thread Dennis Sweeney
Dennis Sweeney added the comment: pip is maintained externally at https://github.com/pypa/pip , so that is likely a better place to open an issue about pip. -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.org/issue46

[issue45806] Cannot Recover From StackOverflow in 3.9 Tests

2022-03-07 Thread Dennis Sweeney
Dennis Sweeney added the comment: Should this be backported to make the 3.8 Buildbots happy? -- ___ Python tracker <https://bugs.python.org/issue45806> ___ ___

[issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug)

2022-03-06 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +29833 pull_request: https://github.com/python/cpython/pull/31718 ___ Python tracker <https://bugs.python.org/issue46

[issue46941] Bug or plug not removed (The operator "is")

2022-03-06 Thread Dennis Sweeney
Dennis Sweeney added the comment: In the future, please copy and paste the relevant code and errors as text. Images of code are harder for screen-readers for the visually impaired, harder to copy-and-paste to verify, and are more likely to be perceived as spam. Your code is essentially

[issue46935] import of submodule polutes global namespace

2022-03-05 Thread Dennis Sweeney
Dennis Sweeney added the comment: This might be something that rapidfuzz can fix, rather than CPython. In whatever import process rapidfuzz uses, it populates sys.modules with a module named `Levenshtein` in addition to 'rapidfuzz.distance.Levenshtein'. You might be able to request

[issue46823] Add LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE combined opcode

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

[issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug)

2022-03-02 Thread Dennis Sweeney
Dennis Sweeney added the comment: a8b9350964f43cb648c98c179c8037fbf3ff8a7d is the first bad commit commit a8b9350964f43cb648c98c179c8037fbf3ff8a7d Author: Mark Shannon Date: Wed Oct 13 14:19:34 2021 +0100 bpo-45340: Don't create object dictionaries unless actually needed (GH-28802

[issue46848] Use optimized string search function in mmap.find()

2022-03-01 Thread Dennis Sweeney
Dennis Sweeney added the comment: Thanks for the report! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> performance ___ Python tracker <https://bugs.python

[issue46848] Use optimized string search function in mmap.find()

2022-03-01 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset 6ddb09f35b922a3bbb59e408a3ca7636a6938468 by Dennis Sweeney in branch 'main': bpo-46848: Use stringlib/fastsearch in mmap (GH-31625) https://github.com/python/cpython/commit/6ddb09f35b922a3bbb59e408a3ca7636a6938468

[issue46891] Crash in ModuleType subclass with __slots__

2022-03-01 Thread Dennis Sweeney
Change by Dennis Sweeney : -- nosy: +Mark.Shannon ___ Python tracker <https://bugs.python.org/issue46891> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46891] Crash in ModuleType subclass with __slots__

2022-03-01 Thread Dennis Sweeney
Dennis Sweeney added the comment: Bisected to here: c3f52b4d707a78eb342372a2be00f3eb846a05b9 is the first bad commit commit c3f52b4d707a78eb342372a2be00f3eb846a05b9 Author: Mark Shannon Date: Wed Jun 23 10:00:43 2021 +0100 bpo-44486: Make sure that modules always have a dictionary

[issue46848] Use optimized string search function in mmap.find()

2022-02-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: PR 31625 is an alternative proposal. It uses the Crochemore and Perrin's Two-Way algorithm that @benrg references (see Objects/stringlib/fastsearch.h and Objects/stringlib/stringlib_find_two_way_notes.txt), and is platform-independent

[issue46848] Use optimized string search function in mmap.find()

2022-02-28 Thread Dennis Sweeney
Change by Dennis Sweeney : -- nosy: +Dennis Sweeney nosy_count: 2.0 -> 3.0 pull_requests: +29749 pull_request: https://github.com/python/cpython/pull/31625 ___ Python tracker <https://bugs.python.org/issu

[issue46823] Add LOAD_FAST__LOAD_ATTR_INSTACE_VALUE combined opcode

2022-02-21 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +29617 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31484 ___ Python tracker <https://bugs.python.org/issu

[issue46823] Add LOAD_FAST__LOAD_ATTR_INSTACE_VALUE combined opcode

2022-02-21 Thread Dennis Sweeney
New submission from Dennis Sweeney : See https://github.com/faster-cpython/ideas/discussions/291 -- messages: 413692 nosy: Dennis Sweeney priority: normal severity: normal status: open title: Add LOAD_FAST__LOAD_ATTR_INSTACE_VALUE combined opcode

[issue46802] Wrong result unpacking binary data with ctypes bitfield.

2022-02-19 Thread Dennis Sweeney
Dennis Sweeney added the comment: Possible duplicate of https://bugs.python.org/issue29753 -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.org/issue46

[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-18 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +29562 pull_request: https://github.com/python/cpython/pull/31427 ___ Python tracker <https://bugs.python.org/issue46

[issue46615] Use-after-free by mutating set during set operations

2022-02-18 Thread Dennis Sweeney
Dennis Sweeney added the comment: It does look like there are some pickle situations that crash. Attached is a randomized crasher. I haven't done too much careful reasoning about it, but adding INCREFs everywhere seems to fix most of the issues. -- Added file: https

[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-17 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset 9e06d03672547041239812efe4901c06da6cbd2f by Christian Heimes in branch 'main': bpo-46730: Fix refleak and tighten NULL checks (GH-31389) https://github.com/python/cpython/commit/9e06d03672547041239812efe4901c06da6cbd2f

[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-15 Thread Dennis Sweeney
Dennis Sweeney added the comment: Thanks for the PR! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-15 Thread Dennis Sweeney

[issue46739] dataclasses __eq__ isn't logical

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

[issue46747] bisect.bisect/insort don't document key parameter

2022-02-14 Thread Dennis Sweeney
Dennis Sweeney added the comment: Thanks for the report, Stefan! Thanks for the PR, Zackery! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46747] bisect.bisect/insort don't document key parameter

2022-02-14 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset 841c77d802e9ee8845fa3152700474021efe03fd by Dennis Sweeney in branch '3.10': [3.10] bpo-46747: Add missing key parameters in the bisect docs (GH-31323) (GH-31329) https://github.com/python/cpython/commit

[issue46747] bisect.bisect/insort don't document key parameter

2022-02-14 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +29485 pull_request: https://github.com/python/cpython/pull/31329 ___ Python tracker <https://bugs.python.org/issue46

[issue46747] bisect.bisect/insort don't document key parameter

2022-02-14 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset 96084f4256d2d523b0a4d7d900322b032326e3ed by Zackery Spytz in branch 'main': bpo-46747: Add missing key parameters in the bisect docs (GH-31323) https://github.com/python/cpython/commit/96084f4256d2d523b0a4d7d900322b032326e3ed -- nosy

[issue34890] Support functools.partial in inspect.is*function() checks

2022-02-12 Thread Dennis Sweeney
Dennis Sweeney added the comment: See https://bugs.python.org/issue46722 for a concern about this change. -- nosy: +Dennis Sweeney ___ Python tracker <https://bugs.python.org/issue34

[issue46615] Use-after-free by mutating set during set operations

2022-02-12 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +29473 pull_request: https://github.com/python/cpython/pull/31312 ___ Python tracker <https://bugs.python.org/issue46

[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-12 Thread Dennis Sweeney
Dennis Sweeney added the comment: Go ahead and open a PR -- it makes it easier to discuss particular changes. Regarding backwards-compatibility, error messages improvements are fair game for Python 3.11, we just shouldn't backport them to earlier versions. We can also consider including

[issue46615] Use-after-free by mutating set during set operations

2022-02-11 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset 4a66615ba736f84eadf9456bfd5d32a94cccf117 by Dennis Sweeney in branch 'main': bpo-46615: Don't crash when set operations mutate the sets (GH-31120) https://github.com/python/cpython/commit/4a66615ba736f84eadf9456bfd5d32a94cccf117

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

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

[issue46717] Raising exception multiple times leaks memory

2022-02-10 Thread Dennis Sweeney
Dennis Sweeney added the comment: I reproduced as far back as Python 3.6 with this: --- import gc exc = Exception() deltas = [] for i in range(2, 15): ref1 = len(gc.get_objects()) for j in range(2**i): try: raise exc except

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

2022-02-10 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset 035414a878a772d1d293cdecdc4470bcce5e5d7a by Dennis Sweeney in branch 'main': bpo-44953: Add newline at end of NEWS entry (GH-31265) https://github.com/python/cpython/commit/035414a878a772d1d293cdecdc4470bcce5e5d7a

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

2022-02-10 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +29431 pull_request: https://github.com/python/cpython/pull/31265 ___ Python tracker <https://bugs.python.org/issue44

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

2022-02-10 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset 0a145069e807fdafd1fa0315b9bc22da363d2d39 by Dennis Sweeney in branch 'main': bpo-44953: Add vectorcall for itemgetter and attrgetter instances (GH-27828) https://github.com/python/cpython/commit/0a145069e807fdafd1fa0315b9bc22da363d2d39

[issue46706] AxelRacer

2022-02-09 Thread Dennis Sweeney
New submission from Dennis Sweeney : I'm closing this -- if you found a bug in Python, please be sure to describe thoroughly what bug you found, steps to reproduce the bug, and what behavior you expected. -- nosy: +Dennis Sweeney resolution: -> not a bug stage: -> resolved

[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Dennis Sweeney
Change by Dennis Sweeney : -- nosy: +rhettinger, serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue46705> ___ ___ Python-bugs-list mailin

[issue46680] file calls itself

2022-02-08 Thread Dennis Sweeney
Dennis Sweeney added the comment: https://stackoverflow.com/ or https://discuss.python.org/c/users/ are better places for this question. -- nosy: +Dennis Sweeney resolution: -> not a bug stage: -> resolved status: open -> closed _

[issue46652] Use code.co_qualname to provide richer information

2022-02-05 Thread Dennis Sweeney
Dennis Sweeney added the comment: Similar changes at bpo-40679 accidentally broke Cython when it was assumed that co_qualname was non-null, which was then fixed by defaulting to co_name in that case. I don't know if Cython still produces cases like that, but we should make sure

[issue46615] Use-after-free by mutating set during set operations

2022-02-03 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +29301 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31120 ___ Python tracker <https://bugs.python.org/issu

[issue46615] Use-after-free by mutating set during set operations

2022-02-03 Thread Dennis Sweeney
Dennis Sweeney added the comment: It looks like usages of the PyDict_Next API assume the resulting references are borrowed and so INCREF them. Usages of set_next do not, but should. It should hopefully be a straightforward fix of adding INCREF/DECREFs

[issue46615] Use-after-free by mutating set during set operations

2022-02-02 Thread Dennis Sweeney
Dennis Sweeney added the comment: set1.isdisjoint(set2) also crashes -- ___ Python tracker <https://bugs.python.org/issue46615> ___ ___ Python-bugs-list mailin

[issue46615] Use-after-free by mutating set during set operations

2022-02-02 Thread Dennis Sweeney
Change by Dennis Sweeney : -- title: Segfault in set intersection (&) and difference (-) -> Use-after-free by mutating set during set operations ___ Python tracker <https://bugs.python.org/

[issue46615] Segfault in set intersection (&) and difference (-)

2022-02-02 Thread Dennis Sweeney
Dennis Sweeney added the comment: replacing `return True` with `return random() < 0.5` makes *all* of the operations crash, except for `|` and `|=`. -- ___ Python tracker <https://bugs.python.org/issu

[issue46615] Segfault in set intersection (&) and difference (-)

2022-02-02 Thread Dennis Sweeney
New submission from Dennis Sweeney : Maybe related to https://bugs.python.org/issue8420 Somewhat obscure, but using only standard Python, and no frame- or gc-hacks, it looks like we can get a use-after-free: from random import random BADNESS = 0.0 class Bad: def __eq__(self, other

[issue45885] Specialize COMPARE_OP

2022-01-31 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +29223 pull_request: https://github.com/python/cpython/pull/31040 ___ Python tracker <https://bugs.python.org/issue45

[issue46561] Descriptor resolution should own arguments passed to descriptors

2022-01-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: Hi Max, My apologies -- my first message was probably too dismissive. Is there any way to make the existing code crash with pure Python, and can we then add such a test case? If not with pure Python, then perhaps with some minimal reproducible example

[issue46528] Simplify the VM's stack manipulations

2022-01-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: Minor nit: I think swaptimize() should check the for PyMem_Malloc returning NULL here. // Create an array with elements {0, 1, 2, ..., depth - 1}: int *stack = PyMem_Malloc(depth * sizeof(int)); for (int i = 0; i < depth; i++) { stac

[issue46561] Descriptor resolution should own arguments passed to descriptors

2022-01-27 Thread Dennis Sweeney
Dennis Sweeney added the comment: Why? Callee-borrowing-from-caller is the established norm across the C API. You mention use-after-free, but can you elaborate on how that can happen in practice? https://docs.python.org/3/extending/extending.html?highlight=borrowed#ownership-rules says

  1   2   3   4   5   6   >