[issue42927] Inline cache for slots

2021-01-13 Thread Guido van Rossum
Change by Guido van Rossum : -- keywords: +patch pull_requests: +23043 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/24216 ___ Python tracker

[issue42927] Inline cache for slots

2021-01-13 Thread Guido van Rossum
New submission from Guido van Rossum : I've been thinking about Python performance improvements, and I played around with an inline cache enhancement that supports slots. The results on a very simple benchmark look promising (30% speedup) but I'm terrible with our benchmarking tools, and this

[issue38250] enum.Flag should be more set-like

2021-01-13 Thread Ethan Furman
Ethan Furman added the comment: The code sample: class Color(IntFlag): BLACK = 0 RED = 1 GREEN = 2 BLUE = 4 PURPLE = RED | BLUE WHITE = RED | GREEN | BLUE Here's the summary of the changes: - single-bit flags are canonical - multi-bit and z

[issue42762] infinite loop resulted by "yield"

2021-01-13 Thread Xinmeng Xia
Xinmeng Xia added the comment: I see,Thank you! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue38250] enum.Flag should be more set-like

2021-01-13 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +23042 pull_request: https://github.com/python/cpython/pull/24215 ___ Python tracker ___

[issue32218] add __iter__ to enum.Flag members

2021-01-13 Thread Ethan Furman
Ethan Furman added the comment: Final outcome: `Flag` has been redesigned such that any flag comprised of a single bit is canonical; flags comprised of multiple bits are considered aliases. During iteration only canonical flags are returned. -- resolution: -> fixed stage: patch re

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-13 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2021-01-13 Thread Jason R. Coombs
Jason R. Coombs added the comment: > Why do we keep setuptools? I agree; would be good to remove it if possible. There are many packages that fail to build without Setuptools being present or --use-pep517 indicated. It would be nice if pip could make --use-pep517 the default, update that in

[issue40956] Use Argument Clinic in sqlite3

2021-01-13 Thread Berker Peksag
Berker Peksag added the comment: New changeset a330365ca5ae836075f306334ab648bf23471481 by Erlend Egeberg Aasland in branch 'master': bpo-40956: Fix sqlite3.Cursor.fetchmany() default value (GH-24214) https://github.com/python/cpython/commit/a330365ca5ae836075f306334ab648bf23471481

[issue42915] enum.Flag ~ bitwise negation is very slow and can't be defined as a Flag value

2021-01-13 Thread Ethan Furman
Ethan Furman added the comment: Yes. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-13 Thread Irit Katriel
Irit Katriel added the comment: I’m not sure I agree that it’s a big win. You can always add such a utility function in your code. -- ___ Python tracker ___ ___

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-13 Thread Ulrich Petri
Ulrich Petri added the comment: Functionally equivalent code would be: print("".join(TracebackException.from_exception(ex, capture_locals=True).format())) vs. (hypothetically) print_exc(capture_locals=True) Which is quite a significant difference IMO. -- _

[issue42915] enum.Flag ~ bitwise negation is very slow and can't be defined as a Flag value

2021-01-13 Thread Kevin Chen
Kevin Chen added the comment: Awesome thanks! Does the rewrite fix the issue with creating negated flags as well? -- ___ Python tracker ___ __

[issue42925] Error trace of else inside class

2021-01-13 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +Mark.Shannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue40956] Use Argument Clinic in sqlite3

2021-01-13 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- pull_requests: +23041 pull_request: https://github.com/python/cpython/pull/24214 ___ Python tracker ___ __

[issue40956] Use Argument Clinic in sqlite3

2021-01-13 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: Thanks, but I prefer the following: size as maxrows: int(c_default='self->arraysize', py_default='') = 1 -- ___ Python tracker ___

[issue28146] Confusing error messages in str.format()

2021-01-13 Thread Irit Katriel
Irit Katriel added the comment: My PR fixes the second case ('{: }') and Serhiy's PR on Issue27772 fixes the first case ('{:04}'). -- ___ Python tracker ___ _

[issue28146] Confusing error messages in str.format()

2021-01-13 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch nosy: +iritkatriel nosy_count: 4.0 -> 5.0 pull_requests: +23040 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24213 ___ Python tracker _

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-01-13 Thread Guido van Rossum
Guido van Rossum added the comment: > "The implementation is allowed to skip any boolean test of a value, when it > has *no* effect on the flow of the program and at least one test has already > been performed on that value." +1 -- ___ Python tra

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-01-13 Thread Steve Stagg
Steve Stagg added the comment: Sounds great to me (with my approximately zero optimizer experience) At risk of taking this too far, you /could/ add something like: "skip any boolean test of a value _immediately_ following another boolean test, when it has no ..." to this spec/guidance/whate

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-01-13 Thread Mark Shannon
Mark Shannon added the comment: I missed a "no" in the above, which somewhat changed the meaning! It should have read: "The implementation is allowed to skip any boolean test of a value, when it has *no* effect on the flow of the program and at least one test has already been performed on t

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-01-13 Thread Mark Shannon
Mark Shannon added the comment: The problem with using a specific syntax example, is that the optimizer doesn't work that way. It works on the CFG. Any specification needs to be phrased in terms of general control flow, as other optimizations can enable this transformation. e.g. if x or Tr

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2021-01-13 Thread Mark Shannon
Change by Mark Shannon : -- nosy: +lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue34705] Python 3.8 changes how returns through finally clauses are traced

2021-01-13 Thread Mark Shannon
Mark Shannon added the comment: In master, the sequence of events is: 1 call 2 line 3 line returning 4 line 6 line finally 6 return which is the same as 3.7. I now believe this is the correct trace, as the language spec states: When a return, break or continue statement is executed in the try

[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-01-13 Thread miss-islington
Change by miss-islington : -- pull_requests: +23039 pull_request: https://github.com/python/cpython/pull/24212 ___ Python tracker ___ __

[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-01-13 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +23038 pull_request: https://github.com/python/cpython/pull/24211 ___ Python tracker _

[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-01-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 61d8c54f43a7871d016f98b38f86858817d927d5 by Tobias Holl in branch 'master': bpo-42924: Fix incorrect copy in bytearray_repeat (GH-24208) https://github.com/python/cpython/commit/61d8c54f43a7871d016f98b38f86858817d927d5 -- nosy: +serh

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-01-13 Thread Guido van Rossum
Guido van Rossum added the comment: Is anyone still in favor of eliminating the __bool__ call from ‘if p: pass’? -- ___ Python tracker ___ _

[issue2506] Add mechanism to disable optimizations

2021-01-13 Thread Mark Shannon
Mark Shannon added the comment: In general, it is hard to define what is an optimization, and what is part of the compiler. The original request was to disable optimizations that changed observable behavior w.r.t. line numbers. All optimizations now respect line numbers, so proposed mechani

[issue42926] Split compiler into code-gen, optimizer and assembler.

2021-01-13 Thread Guido van Rossum
Guido van Rossum added the comment: SGTM. But I’m not the one who has to work with it. -- nosy: +gvanrossum ___ Python tracker ___ _

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2021-01-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Pablo, are you OK closing this without a 3.8 backport? I would be supportive, but we should check with Łukasz as he is the release manager of 3.8 -- ___ Python tracker

[issue42693] "if 0:" lines are traced; they didn't use to be

2021-01-13 Thread Mark Shannon
Mark Shannon added the comment: Unless anyone objects, I'm going to close this issue. -- ___ Python tracker ___ ___ Python-bugs-lis

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-01-13 Thread Steve Stagg
Steve Stagg added the comment: Oops, sorry, didn't realise there were such rules. The reasoning for me making the change to the title is that that the original PR didn't mention skipping actual condition logic, but does mention skipping unreachable blocks, with the examples provided (eithe

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2021-01-13 Thread Mark Shannon
Mark Shannon added the comment: Pablo, are you OK closing this without a 3.8 backport? -- ___ Python tracker ___ ___ Python-bugs-li

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-01-13 Thread Mark Shannon
Change by Mark Shannon : -- title: Is it legal to eliminate tests of a value, when that test has no effect on control flow -> Is it legal to eliminate tests of a value, when that test has no effect on control flow? ___ Python tracker

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow

2021-01-13 Thread Mark Shannon
Mark Shannon added the comment: Steve, Please don't change the title of the issue. Sure, the optimizer is "inconsistent". Optimizations are applied in some cases, and not in others. That's just how compilers work. The issue here is whether the optimizer is allowed to skip the call to __bool_

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2021-01-13 Thread Irit Katriel
Irit Katriel added the comment: There were additional merge conflicts when I tried to create a manual 3.8 backport, more significant than the 3.9 ones IIRC. -- ___ Python tracker ___

[issue40956] Use Argument Clinic in sqlite3

2021-01-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Use NULL. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2021-01-13 Thread Mark Shannon
Mark Shannon added the comment: Does this need backporting to 3.8, or is 3.9 sufficient? -- ___ Python tracker ___ ___ Python-bugs-

[issue42914] pprint numbers with underscore

2021-01-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> format(10**9, '_d') '1_000_000_000' -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ P

[issue42926] Split compiler into code-gen, optimizer and assembler.

2021-01-13 Thread Mark Shannon
New submission from Mark Shannon : Currently the compiler operates in three main passes: Code-gen Optimize Assemble The problem is that these passes use the same basic-block based CFG, leading to unnecessary coupling and inefficiencies. A basic block CFG is awkward and error-prone for the cod

[issue42856] ensurepip: add configure --with-wheel-pkg-dir=PATH to get wheel packages from a system directory

2021-01-13 Thread Miro Hrončok
Miro Hrončok added the comment: In Fedora, we update the wheels independently without rebuilding Python. What incredible convoluted constructs do you have in mind in particular? -- ___ Python tracker ___

[issue42856] ensurepip: add configure --with-wheel-pkg-dir=PATH to get wheel packages from a system directory

2021-01-13 Thread Matej Cepl
Matej Cepl added the comment: We (SUSE) have updated versions of the wheels as special Sources, and then this in the %prep stage of our SPEC file: # Replace bundled wheels with the updates ones rm -v Lib/ensurepip/_bundled/*.whl cp -v %{SOURCE20} %{SOURCE21} Lib/ensurepip/_bundled

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-13 Thread Irit Katriel
Irit Katriel added the comment: That said, you can always use TracebackException.from_exception(exc, capture_locals=True).format() which is not much longer than print_exception(exc, capture_locals=True) -- ___ Python tracker

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-13 Thread Irit Katriel
Irit Katriel added the comment: Sorry, I spoke too soon - see now that the locals are use in the StackSummary.format(). -- ___ Python tracker ___

[issue42856] ensurepip: add configure --with-wheel-pkg-dir=PATH to get wheel packages from a system directory

2021-01-13 Thread Matej Cepl
Change by Matej Cepl : -- nosy: +mcepl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-13 Thread Irit Katriel
Irit Katriel added the comment: I don't understand this request. If you ask TracebackExceptions to capture_locals then the FrameSummary object gets a dict of the reprs of the locals, which can be introspected and participate in __eq__ checks but nothing else happens with them. What would the

[issue42856] ensurepip: add configure --with-wheel-pkg-dir=PATH to get wheel packages from a system directory

2021-01-13 Thread STINNER Victor
STINNER Victor added the comment: > For simplicity, I would avoid mixing wheels from 2 different directories. Right. I wrote PR 24210 which is simpler. It either uses bundled wheels, or wheels from the directory. -- ___ Python tracker

[issue42856] ensurepip: add configure --with-wheel-pkg-dir=PATH to get wheel packages from a system directory

2021-01-13 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23037 pull_request: https://github.com/python/cpython/pull/24210 ___ Python tracker ___ __

[issue42908] Incorrect line numbers at end of try-except and with statements containing if False: pass

2021-01-13 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +23036 pull_request: https://github.com/python/cpython/pull/24209 ___ Python tracker ___

[issue42922] Enlace a descripción de función 'dir' faltante

2021-01-13 Thread Mariatta
Mariatta added the comment: Hi, the Spanish translation for Python docs is managed at https://github.com/python/python-docs-es Can you please open the issue there? Thanks you. Really sorry that I don't speak Spanish :( so I'm replying in English. -- nosy: +Mariatta resolution: ->

[issue42877] TracebackException saves more data than it needs for format

2021-01-13 Thread Irit Katriel
Change by Irit Katriel : -- title: TracebackException saves more data than it needs -> TracebackException saves more data than it needs for format ___ Python tracker ___ _

[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-01-13 Thread tholl
Change by tholl : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.o

[issue42914] pprint numbers with underscore

2021-01-13 Thread Eric V. Smith
Eric V. Smith added the comment: +1 also. I agree with Raymond it should be optional. -- nosy: +eric.smith ___ Python tracker ___ _

[issue42925] Error trace of else inside class

2021-01-13 Thread ChenXuan
ChenXuan <522169...@qq.com> added the comment: another example: if 1 < 10: b = 1 if 0: a = 1 else: a = 1 output: 1: if 1 < 10: 1: b = 1 1: if 0: 1: a = 1 else: a = 1 Is this a bug or feature? -- _

[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-01-13 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +23035 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24208 ___ Python tracker _

[issue42925] Error trace of else inside class

2021-01-13 Thread ChenXuan
New submission from ChenXuan <522169...@qq.com>: Hi, python3.10 seems to give wrong trace here: class A: if 3 < 9: a = 1 else: a = 2 result: 2: class A: 1:if 3 < 9: 1: a = 1 else: 1: a = 2 command: python3.10 -m trace --count

[issue42908] Incorrect line numbers at end of try-except and with statements containing if False: pass

2021-01-13 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue42908] Incorrect line numbers at end of try-except and with statements containing if False: pass

2021-01-13 Thread Mark Shannon
Mark Shannon added the comment: New changeset 3bd6035b6baf1a7d51b7cc2c6bb2c81886236b67 by Mark Shannon in branch 'master': bpo-42908: Mark cleanup code at end of try-except and with artificial (#24202) https://github.com/python/cpython/commit/3bd6035b6baf1a7d51b7cc2c6bb2c81886236b67 ---

[issue42843] What min_sphinx for Python 3.10

2021-01-13 Thread Matthias Klose
Matthias Klose added the comment: Ubuntu 20.04 LTS still sees subminor Python 3.8 version updates, and needs to use sphinx 1.8.5. -- nosy: +doko ___ Python tracker ___ __

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-13 Thread STINNER Victor
STINNER Victor added the comment: > It's common that Python crashes are coming from third party extension > modules, rather than Python itself. Recent example: bpo-42891 crash (...) Another recent example: bpo-42879 "python: Objects/abstract.c:155: PyObject_GetItem: Assertion `(item != NULL)

[issue40956] Use Argument Clinic in sqlite3

2021-01-13 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: I don't see how to easily solve this in AC: we want the arraysize of the cursor instance, but I don't see how I'm going to get this via the AC namespace/context. Using a "bogus" default value works: size as maxrows: int(c_default='self->arraysize') =

[issue42879] SystemError from class 'int'

2021-01-13 Thread STINNER Victor
STINNER Victor added the comment: > I'll close this here, since that report indicates a bug in Pygame. FYI I created bpo-42923 "Py_FatalError(): dump the list of extension modules" to help users to understand that the error can come from third party C extensions rather than Python itself. -

[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-01-13 Thread tholl
New submission from tholl : `bytearray_repeat` uses `ob_bytes` rather than `ob_start` as its source data for copying, leading to incorrect results in some edge cases where the two are distinct. It should probably use `PyByteArray_AS_STRING(self)` just like `bytearray_irepeat` and basically al

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-13 Thread STINNER Victor
STINNER Victor added the comment: Example using PR 24207, the new part the "Extension modules:" list at the end: --- $ ./python -X faulthandler Python 3.10.0a4+ (heads/master-dirty:2396614b89, Jan 13 2021, 12:09:15) >>> import ctypes >>> ctypes.string_at(0) Fatal Python error: Segm

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-13 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +23034 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24207 ___ Python tracker ___ _

[issue40956] Use Argument Clinic in sqlite3

2021-01-13 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: Looks like this is the culprit: https://github.com/python/cpython/blob/2396614b8958ad202378fd71a598eb4106ac5896/Modules/_sqlite/cursor.c#L825 -- ___ Python tracker

[issue42911] Addition chains for pow saves 10 % time!

2021-01-13 Thread Jurjen N.E. Bos
Change by Jurjen N.E. Bos : -- keywords: +patch pull_requests: +23032 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24206 ___ Python tracker ___

[issue42899] Inconsistent elimination of empty blocks by optimizer causes __bool__calls to be skipped in some exception handling scenarios

2021-01-13 Thread Steve Stagg
Steve Stagg added the comment: I re-read the change that introduced this, and the situation is slightly more complex. While the wording is understandably slightly ambiguous, the change talks about the following example: if a: pass else: In this scenario, the compiler is trying to elim

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-13 Thread STINNER Victor
New submission from STINNER Victor : When Python cannot report an error and its is not possible to recover from the error, Py_FatalError() displays an error message and exit immediately Python. It's common that Python crashes are coming from third party extension modules, rather than Python i

[issue40956] Use Argument Clinic in sqlite3

2021-01-13 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: GH-24007 introduced a regression: >>> import sqlite3 >>> help(sqlite3) Traceback (most recent call last): File "Lib/inspect.py", line 2049, in wrap_value value = eval(s, module_dict) File "", line 1, in NameError: name 'cursor' is not defined

[issue42893] Strange XPath search behavior of xml.etree.ElementTree.Element.find

2021-01-13 Thread Christian Heimes
Christian Heimes added the comment: etree's find method supports a limited subset of XPath, https://docs.python.org/3/library/xml.etree.elementtree.html#supported-xpath-syntax . e.find("./*[2]") seems to trigger undefined behavior. The limited XPath syntax for positions is documented as "pos

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2021-01-13 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset 2396614b8958ad202378fd71a598eb4106ac5896 by Dong-hee Na in branch 'master': bpo-1635741: Fix PyModule_AddObjectRef to use EXPORT_FUNC (GH-24205) https://github.com/python/cpython/commit/2396614b8958ad202378fd71a598eb4106ac5896 -- ___

[issue42289] Found a secret/private key in code.

2021-01-13 Thread Irit Katriel
Change by Irit Katriel : -- status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue42879] SystemError from class 'int'

2021-01-13 Thread Mark Dickinson
Mark Dickinson added the comment: Downstream issue is here: https://github.com/pygame/pygame/issues/2442 I'll close this here, since that report indicates a bug in Pygame. -- resolution: -> third party stage: -> resolved status: open -> closed __

[issue42848] asyncio produces an unexpected traceback with recursive __getattribute__

2021-01-13 Thread Irit Katriel
Irit Katriel added the comment: Yes, I agree this is more of a refactor than a bugfix. -- versions: +Python 3.10 -Python 3.8 ___ Python tracker ___ ___

[issue42922] Enlace a descripción de función 'dir' faltante

2021-01-13 Thread Jose MONTES PEREZ
New submission from Jose MONTES PEREZ : En la tabla de enlaces a funciones de la página: https://docs.python.org/es/3/library/functions.html no existe un link a la función 'dir' tal como: https://docs.python.org/es/3/library/functions.html#dir en su lugar está duplicado el enlace a la función 'a