[issue46498] Add new triplets for loongarch64

2022-01-27 Thread Zhang Na


Zhang Na  added the comment:

loongarch64.diff has been modified according to the new toolchain spec.

--
Added file: https://bugs.python.org/file50590/loongarch64-new.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-01-27 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Sorry, I didn't look into docs before writing.
Now we have an interesting situation: the documentation reflects the desired 
state already but the code is not :)

The PR should contain fixes for transports.py and sslproto.py only (plus a 
blurb record for NEWs).

Sorry for misleading you.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-01-27 Thread Kumar Aditya


Change by Kumar Aditya :


--
nosy: +kumaraditya303

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42982] Update suggested number of iterations for pbkdf2_hmac()

2022-01-27 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +29130
pull_request: https://github.com/python/cpython/pull/30951

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42982] Update suggested number of iterations for pbkdf2_hmac()

2022-01-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 897ce9018775bcd679fb49aa17258f8f6e818e23 by Illia Volochii in 
branch 'main':
bpo-42982: Improve the text on suggested number of iterations of PBKDF2 
(GH-24276)
https://github.com/python/cpython/commit/897ce9018775bcd679fb49aa17258f8f6e818e23


--
nosy: +gregory.p.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42982] Update suggested number of iterations for pbkdf2_hmac()

2022-01-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I reworked the PR and went with less specific text and linking to the NIST 800 
132 appendix as guidance on how people should determine what is right for them.

there is no one right number.  it is application specific.

thanks for everyone's valuable input!

--
assignee: docs@python -> gregory.p.smith
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42982] Update suggested number of iterations for pbkdf2_hmac()

2022-01-27 Thread miss-islington


miss-islington  added the comment:


New changeset 1ecc98dedb7ae77c2d806a70b52dfecdac39ff5b by Miss Islington (bot) 
in branch '3.10':
bpo-42982: Improve the text on suggested number of iterations of PBKDF2 
(GH-24276)
https://github.com/python/cpython/commit/1ecc98dedb7ae77c2d806a70b52dfecdac39ff5b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45173] Remove configparser deprecations

2022-01-27 Thread Hugo van Kemenade


Change by Hugo van Kemenade :


--
pull_requests: +29131
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30952

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40280] Consider supporting emscripten/webassembly as a build target

2022-01-27 Thread miss-islington


miss-islington  added the comment:


New changeset 606e496dd6e2ace298532da200169124c26ae0f2 by Christian Heimes in 
branch 'main':
bpo-40280: Use presence of msvcrt module to detect Windows (GH-30930)
https://github.com/python/cpython/commit/606e496dd6e2ace298532da200169124c26ae0f2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23556] [doc] Scope for raise without argument is different in Python 2 and 3

2022-01-27 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 9.0 -> 10.0
pull_requests: +29132
pull_request: https://github.com/python/cpython/pull/30953

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23556] [doc] Scope for raise without argument is different in Python 2 and 3

2022-01-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29133
pull_request: https://github.com/python/cpython/pull/30954

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23556] [doc] Scope for raise without argument is different in Python 2 and 3

2022-01-27 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 08c0ed2d9c0d01ad1a5adc0787bc75e4e90cbb85 by Kinshuk Dua in branch 
'main':
bpo-23556: [doc] Fix inaccuracy in documentation for raise without args. 
Improve tests for context in nested except handlers.  (GH-29236)
https://github.com/python/cpython/commit/08c0ed2d9c0d01ad1a5adc0787bc75e4e90cbb85


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46544] `textwrap.TextWrapper` leaks two intermediate vars into class namespace

2022-01-27 Thread Nikita Sobolev


New submission from Nikita Sobolev :

Right now this works:

```
>>> import textwrap
>>> textwrap.TextWrapper.x
' '
>>> textwrap.TextWrapper.uspace
32
```

This happens because of these lines: 
https://github.com/python/cpython/blame/606e496dd6e2ace298532da200169124c26ae0f2/Lib/textwrap.py#L66-L69

Notice that `uspace` and `x` are both undocumented, untested, and unused in our 
code.

Similar variables in the same class body are then deleted from the scope:

```
wordsep_simple_re = re.compile(r'(%s+)' % whitespace)
del whitespace
```

1. 
https://github.com/python/cpython/blame/606e496dd6e2ace298532da200169124c26ae0f2/Lib/textwrap.py#L99
2. 
https://github.com/python/cpython/blame/606e496dd6e2ace298532da200169124c26ae0f2/Lib/textwrap.py#L106

I propose to add `del x, uspace` as well. These two probably should not be 
leaking and should not be exposed.

--
components: Library (Lib)
messages: 411849
nosy: sobolevn
priority: normal
severity: normal
status: open
title: `textwrap.TextWrapper` leaks two intermediate vars into class namespace
type: behavior
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46545] `textwrap.TextWrapper` leaks two intermediate vars into class namespace

2022-01-27 Thread Nikita Sobolev


New submission from Nikita Sobolev :

Right now this works:

```
>>> import textwrap
>>> textwrap.TextWrapper.x
' '
>>> textwrap.TextWrapper.uspace
32
```

This happens because of these lines: 
https://github.com/python/cpython/blame/606e496dd6e2ace298532da200169124c26ae0f2/Lib/textwrap.py#L66-L69

Notice that `uspace` and `x` are both undocumented, untested, and unused in our 
code.

Similar variables in the same class body are then deleted from the scope:

```
wordsep_simple_re = re.compile(r'(%s+)' % whitespace)
del whitespace
```

1. 
https://github.com/python/cpython/blame/606e496dd6e2ace298532da200169124c26ae0f2/Lib/textwrap.py#L99
2. 
https://github.com/python/cpython/blame/606e496dd6e2ace298532da200169124c26ae0f2/Lib/textwrap.py#L106

I propose to add `del x, uspace` as well. These two probably should not be 
leaking and should not be exposed.

--
components: Library (Lib)
messages: 411850
nosy: sobolevn
priority: normal
severity: normal
status: open
title: `textwrap.TextWrapper` leaks two intermediate vars into class namespace
type: behavior
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46545] `textwrap.TextWrapper` leaks two intermediate vars into class namespace

2022-01-27 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

Oups, somehow I created two identical issues. Closing this one.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46544] `textwrap.TextWrapper` leaks two intermediate vars into class namespace

2022-01-27 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
keywords: +patch
pull_requests: +29134
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30955

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34781] infinite waiting in multiprocessing.Pool

2022-01-27 Thread Antonio Vázquez Blanco

Change by Antonio Vázquez Blanco :


--
nosy: +antonio.vazquez

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23556] [doc] Scope for raise without argument is different in Python 2 and 3

2022-01-27 Thread miss-islington


miss-islington  added the comment:


New changeset 1440dd343871645c187028916dd6ee97300d2557 by Miss Islington (bot) 
in branch '3.9':
bpo-23556: [doc] Fix inaccuracy in documentation for raise without args. 
Improve tests for context in nested except handlers.  (GH-29236)
https://github.com/python/cpython/commit/1440dd343871645c187028916dd6ee97300d2557


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23556] [doc] Scope for raise without argument is different in Python 2 and 3

2022-01-27 Thread miss-islington


miss-islington  added the comment:


New changeset 2572c670d42887e4b1d2475b8da2e9bf6e0aa558 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-23556: [doc] Fix inaccuracy in documentation for raise without args. 
Improve tests for context in nested except handlers.  (GH-29236) (GH-30953)
https://github.com/python/cpython/commit/2572c670d42887e4b1d2475b8da2e9bf6e0aa558


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23556] [doc] Scope for raise without argument is different in Python 2 and 3

2022-01-27 Thread Irit Katriel


Irit Katriel  added the comment:

Thank you @a3nm, @kinshukdua2 and @martin.panter.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable

2022-01-27 Thread Nikita Sobolev


New submission from Nikita Sobolev :

Right now in `DeprecatedList` there's a possibly unwated name leak of 
`method_name` here: 
https://github.com/python/cpython/blob/08c0ed2d9c0d01ad1a5adc0787bc75e4e90cbb85/Lib/importlib/metadata/__init__.py#L295-L308

```
for method_name in [
'__setitem__',
'__delitem__',
'append',
'reverse',
'extend',
'pop',
'remove',
'__iadd__',
'insert',
'sort',
]:
locals()[method_name] = _wrap_deprecated_method(method_name)
```

Example:

```
>>> import importlib
>>> import importlib.metadata
>>> importlib.metadata.DeprecatedList.method_name
'sort'
```

Right now `method_name` is unused, undocumented, and untested.

My proposal is to add `del method_name` after the `for` loop, so it won't leak.

--
components: Library (Lib)
messages: 411855
nosy: brett.cannon, jaraco, sobolevn
priority: normal
severity: normal
status: open
title: `importlib.metadata.DeprecatedList` leaks `method_name` variable
type: behavior
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable

2022-01-27 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
keywords: +patch
pull_requests: +29135
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30956

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46547] `pydoc.Helper` leaks several `for` loop variables

2022-01-27 Thread Nikita Sobolev


New submission from Nikita Sobolev :

Here's the problem. `pydoc.Helper` is defined as:

```
class Helper:
for topic, symbols_ in _symbols_inverse.items():
for symbol in symbols_:
topics = symbols.get(symbol, topic)
if topic not in topics:
topics = topics + ' ' + topic
symbols[symbol] = topics
```

Link: 
https://github.com/python/cpython/blob/08c0ed2d9c0d01ad1a5adc0787bc75e4e90cbb85/Lib/pydoc.py#L1877-L1882

It causes some unwanted consequences: `topic, symbols_, symbol` are leaking to 
the class's namespace. Example:

```
>>> import pydoc
>>> pydoc.Helper.symbol
'J'
>>> pydoc.Helper.topic
'COMPLEX'
>>> pydoc.Helper.symbols_
('j', 'J')
```

There's also `topics` var, but it is shadowed later.

So, I propose deleting all intermediate variables right after the `for` loop.

--
components: Library (Lib)
messages: 411856
nosy: sobolevn
priority: normal
severity: normal
status: open
title: `pydoc.Helper` leaks several `for` loop variables
type: behavior
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46547] `pydoc.Helper` leaks several `for` loop variables

2022-01-27 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
keywords: +patch
pull_requests: +29136
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30957

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46548] macOS installers cannot be signed on Monterey

2022-01-27 Thread Robert Xiao


New submission from Robert Xiao :

I am building unofficial macOS packages for personal use. My main build machine 
is running macOS Monterey 12.1 and Xcode 13.2.1. I recently attempted to build 
Python 3.8.12 as a package using build-installer.py. This worked fine after a 
bit of dependency wrangling (mostly, downloading the right Tcl/Tk source files 
manually) and produced an installer package and DMG as expected.

However, it is apparently impossible to actually sign the package. I receive 
the following error:

% productsign --sign 'Apple Development: ...' 
/private/tmp/_py/installer/Python.mpkg 
/private/tmp/_py/installer/Python-signed.mpkg
productsign: preparing "Python.mpkg" for signing ...
productsign: error: component package "PythonFramework-3.8.pkg" uses legacy 
installer features that make it impossible to sign.

Unfortunately, searching for "legacy installer features" yields zero useful 
hits, which is a bit of a surprise. I assume that this error message was added 
to a recent macOS/Xcode build, but I am unable to downgrade easily.

I believe this is probably being triggered because the way the packages are put 
together differs from the way pkgbuild/productbuild would do it. The longer 
term solution would probably be to switch to those tools instead of assembling 
the packages by hand.

Issue reproduces with Python 3.11a4 sources as well, so I'm tagging it as 
applying for 3.8~3.11.

--
components: Build
messages: 411857
nosy: nneonneo
priority: normal
severity: normal
status: open
title: macOS installers cannot be signed on Monterey
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46548] macOS installers cannot be signed on Monterey

2022-01-27 Thread Robert Xiao


Change by Robert Xiao :


--
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42343] threading.local documentation should be on the net...

2022-01-27 Thread Matt B


Matt B  added the comment:

@rhettinger, the docstring[1] alluded to in the docs is quite lengthy. Are you 
suggesting copying it straight across to the standard library documentation? If 
not, can you give (or link to) some documentation standards or other guidance 
on constructing a viable PR?

Also, for newcomer friendly issues, it is helpful to link to instructions on 
how to construct and submit a PR for review. That will increase the likelihood 
of a community-provided fix.

[1]: https://github.com/python/cpython/blob/main/Lib/_threading_local.py

--
nosy: +posita

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46544] `textwrap.TextWrapper` leaks two intermediate vars into class namespace

2022-01-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 82bce54614f8116a40454fbbbf96a3fd460ca7df by Nikita Sobolev in 
branch 'main':
bpo-46544: Do not leak `x` and `uspace` in textwrap.TextWrapper (GH-30955)
https://github.com/python/cpython/commit/82bce54614f8116a40454fbbbf96a3fd460ca7df


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42343] threading.local documentation should be on the net...

2022-01-27 Thread Matt B


Matt B  added the comment:

@ztane, if you are interested in trying your hand at a PR, these will be 
generally useful:

* https://devguide.python.org/
* https://devguide.python.org/documenting/

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-01-27 Thread Nova


Change by Nova :


--
keywords: +patch
pull_requests: +29137
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30958

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46548] macOS installers cannot be signed on Monterey

2022-01-27 Thread Robert Xiao


Robert Xiao  added the comment:

I noticed that the official installer seems to be built using an entirely 
different process, as it produces a single-file .pkg in xar format with an 
embedded Distribution file, rather than an .mpkg directory.

Is there documentation on how these packages are generated? It seems like the 
scripts for that aren't in the Python source tree?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44791] Substitution of ParamSpec in Concatenate

2022-01-27 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +29138
pull_request: https://github.com/python/cpython/pull/30959

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44791] Substitution of ParamSpec in Concatenate

2022-01-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ecfacc362dd7fef7715dcd94f2e2ca6c622ef115 by Serhiy Storchaka in 
branch 'main':
bpo-44791: Fix substitution of ParamSpec in Concatenate with different 
parameter expressions (GH-27518)
https://github.com/python/cpython/commit/ecfacc362dd7fef7715dcd94f2e2ca6c622ef115


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44791] Substitution of ParamSpec in Concatenate

2022-01-27 Thread miss-islington


miss-islington  added the comment:


New changeset 89db09029566cf3af04b540e33fe1ff9b32f8c8b by Miss Islington (bot) 
in branch '3.10':
bpo-44791: Fix substitution of ParamSpec in Concatenate with different 
parameter expressions (GH-27518)
https://github.com/python/cpython/commit/89db09029566cf3af04b540e33fe1ff9b32f8c8b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c7f810b34d91a5c2fbe0a8385562015d2dd961f2 by Kumar Aditya in 
branch 'main':
bpo-46476: Fix memory leak in code objects generated by deepfreeze (GH-30853)
https://github.com/python/cpython/commit/c7f810b34d91a5c2fbe0a8385562015d2dd961f2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-27 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> Can we close this issue? Or is there a remaining task?

3.9 is still affected; we should fix those types first.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-27 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
versions: +Python 3.9 -Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43916] Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-27 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
title: Mark static types newly converted to heap types as immutable: add 
Py_TPFLAGS_DISALLOW_INSTANTIATION type flag -> Check that new heap types cannot 
be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-27 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Kumar! Your change fixed my issue:

$ ./python -I -X showrefcount -c pass
[-5 refs, 0 blocks]

Python no longer leaks memory at exit: it "leaks" exactly *zero* memory block.

The negative reference count is likely caused by bpo-46449.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43916] Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-27 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

FYI: There are only two bug-fix releases left for 3.9.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal)

2022-01-27 Thread STINNER Victor


STINNER Victor  added the comment:

The bpo-46476 added _Py_Deepfreeze_Fini() and _PyStaticCode_Dealloc() 
functions: commit c7f810b34d91a5c2fbe0a8385562015d2dd961f2. If we need to ajust 
_Py_RefTotal manually, *maybe* it can be done there?

I don't understand well how static/immortal code object lead to negative 
_Py_RefTotal. For me, Py_INCREF() and Py_DECREF() should still be used on these 
objects, no?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46549] Error in list comprehension conditionals when used in class attributes

2022-01-27 Thread din14970


New submission from din14970 :

I discovered this one by accident. When using a conditional inside a list 
comprehension in class attributes one can get some unexpected behavior. The 
following does not work:

```
class TestClass:
list_1 = [1, 2, 3, 4, 5]
exclude = [2, 4]
list_2 = [i for i in list_1 if i not in exclude]
```

It throws a `NameError` saying exclude isn't defined. The following snippets do 
work:

```
exclude = [2, 4]

class TestClass:
list_1 = [1, 2, 3, 4, 5]
list_2 = [i for i in list_1 if i not in exclude]
```

```
class TestClass:
list_1 = [1, 2, 3, 4, 5]
exclude = [2, 4]
list_2 = []
for i in list_1:
 if i not in exclude:
   list_2.append(i)
```

```
class TestClass:
list_1 = [1, 2, 3, 4, 5]
exclude = [2, 4]
list_2 = [i for i in list_1]
```


So it seems that only when a class attribute is used in the conditional part of 
another class attribute a `NameError` is raised.

--
components: Interpreter Core
messages: 411869
nosy: din14970
priority: normal
severity: normal
status: open
title: Error in list comprehension conditionals when used in class attributes
type: behavior
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread Petr Viktorin


Petr Viktorin  added the comment:

> The first and last test should use assertAlmostEqual with a suitable 
> tolerance (the default tolerance is probably fine).

The merged PR only added tolerance to the last test. On some architectures, the 
first test still fails.
(No one is to blame -- this comment should apply to one line but GitHub shows 
two lines as context: 
https://github.com/python/cpython/pull/27343#pullrequestreview-714345826 )

Karolina's new PR is waiting for CLA confirmation.

--
nosy: +petr.viktorin
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46458] Optimise try-except code generation for the happy path

2022-01-27 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 3d2ce3471646704ebd5252f4b20f065f139a53b1 by Irit Katriel in 
branch 'main':
bpo-46458: emit code for else of a try block immediately after the try body 
(GH-30751)
https://github.com/python/cpython/commit/3d2ce3471646704ebd5252f4b20f065f139a53b1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2022-01-27 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks to recent enhancements, epecially in bpo-46417, the last memory blocks 
are now released at Python exit! The initial issue has been fixed!!! This bug 
was 15 years old! Current main branch:

$ ./python -I -X showrefcount -c pass
[-5 refs, 0 blocks]

"0 blocks" means that Python no longer leaks memory at exit. You can use 
Valgrind to check it ;-)

The negative reference count is being discussed in bpo-46449.

I close this issue since it has an insane history: too many pull requests, 
changes, etc.

While the work is not 100% done (we need to convert remaining static types to 
heap types, and convert extensions to multi-phase init), I prefer to address 
remaining issues in (existing or new) separated issues. See for example the 
bpo-40077: "Convert static types to heap types: use PyType_FromSpec()".

I would like to thank everybody who helped to fix this issue! It's hard to list 
all names since this issue is a meta issues made of many sub-issues which also 
have sub-issues. Authors of PEP 573 and PEP 630 also helped fixing this issue!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11 -Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46549] Error in list comprehension conditionals when used in class attributes

2022-01-27 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I believe this is a duplicate of bpo-45899

--
nosy: +Dennis Sweeney

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43916] Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-27 Thread STINNER Victor


STINNER Victor  added the comment:

> 3.9 is still affected; we should fix those types first.

I'm against backporting the new type flag, but we can try to set explicitly 
tp_set to NULL *after* calling PyType_Ready().

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46549] Error in list comprehension conditionals when used in class attributes

2022-01-27 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

See also 
https://stackoverflow.com/questions/13905741/accessing-class-variables-from-a-list-comprehension-in-the-class-definition

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29139
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/30960

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset aa78287bc6d1c4fc07ee134642eb72db67b771a0 by Karolina Surma in 
branch 'main':
bpo-44734: Fix floating point precision in test_turtle (GH-30910)
https://github.com/python/cpython/commit/aa78287bc6d1c4fc07ee134642eb72db67b771a0


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29140
pull_request: https://github.com/python/cpython/pull/30961

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache

2022-01-27 Thread miss-islington


miss-islington  added the comment:


New changeset 5c39e474dbd61397c2ff877fa17d742bf4646702 by Petr Viktorin in 
branch '3.10':
[3.10] bpo-45703: Invalidate _NamespacePath cache on importlib.invalidate_cache 
(GH-29384) (GH-30922)
https://github.com/python/cpython/commit/5c39e474dbd61397c2ff877fa17d742bf4646702


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46098] Missing test for multi-line errors in traceback

2022-01-27 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 183f8d57fa5959e7578e7f470edc364edb23caca by Russel Webber in 
branch 'main':
bpo-46098: Add test for multiline syntax error traceback (GH-30695)
https://github.com/python/cpython/commit/183f8d57fa5959e7578e7f470edc364edb23caca


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42982] Update suggested number of iterations for pbkdf2_hmac()

2022-01-27 Thread April King


April King  added the comment:

The code snippet still uses 10. Given that many people will simply 
copy-and-paste without questioning, should we update that too?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread miss-islington


miss-islington  added the comment:


New changeset 486a4b382943ed4c965a0a36b177e8e0b083a6e5 by Miss Islington (bot) 
in branch '3.10':
bpo-44734: Fix floating point precision in test_turtle (GH-30910)
https://github.com/python/cpython/commit/486a4b382943ed4c965a0a36b177e8e0b083a6e5


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread miss-islington


miss-islington  added the comment:


New changeset 8e98ccc4c3fd1a12f168466422d206d814eba0f9 by Miss Islington (bot) 
in branch '3.9':
bpo-44734: Fix floating point precision in test_turtle (GH-30910)
https://github.com/python/cpython/commit/8e98ccc4c3fd1a12f168466422d206d814eba0f9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread Petr Viktorin


Change by Petr Viktorin :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46098] Missing test for multi-line errors in traceback

2022-01-27 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46098] Missing test for multi-line errors in traceback

2022-01-27 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Tests

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable

2022-01-27 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Thanks Nikita for the report. I agree, it's inelegant that this property leaks. 
Because this code is synced with importlib_metadata, I'm not sure it's worth 
the effort of changing it here. Your change here implies a cherry-pick to the 
backport and updating its changelog there too.

I'd be more inclined to accept a change like this on importlib_metadata, which 
has a faster iteration and whose changes get naturally incorporated into 
CPython periodically.

What's the harm in leaving this attribute on a class that is itself standing in 
for deprecated behavior and slated for removal?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31582] Add _pth breadcrumb to sys.path documentation

2022-01-27 Thread Russel Webber


Russel Webber  added the comment:

I am happy to take a look at improving the documentation. I see the new 
getpath.py has very extensive commenting. Should I simply mention ._pth files 
as in the original issue from 5 years ago, or are you looking for documentation 
of how sys.path is initialised based on the comments in getpath.py?

--
nosy: +RusselWebber

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46416] Direct invocation of `Lib/test/test_typing.py` fails

2022-01-27 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal)

2022-01-27 Thread Christian Heimes


Christian Heimes  added the comment:

The problem is in PyImport_ImportFrozenModuleObject -> unmarshal_frozen_code() 
-> frozen_info.get_code() -> _Py_get_importlib__bootstrap_external_toplevel() 
call chain.

PyImport_ImportFrozenModuleObject() expects unmarshal_frozen_code() to return a 
strong reference to the code object. However a frozen_info struct with a 
get_code() function returns a borrowed reference from deepfreeze.c's toplevel 
code object.

# --- test.c
#include 
int main(int argc, char *argv[])
{
for (int i=1; i <= 100; i++) {
Py_SetProgramName(L"./_testembed");
Py_Initialize();
Py_Finalize();
printf("Loop #%d: %zd refs, bootstrap refs: %zd\n", i, _Py_RefTotal, 
Py_REFCNT(_Py_get_importlib__bootstrap_external_toplevel()));
}
}
# ---

$ gcc -IInclude -I. -o test test.c libpython3.11d.a -lm && ./test
Loop #1: -3 refs, bootstrap refs: 8
Loop #2: -8 refs, bootstrap refs: 7
Loop #3: -13 refs, bootstrap refs: 6
Loop #4: -18 refs, bootstrap refs: 5
Loop #5: -23 refs, bootstrap refs: 4
Loop #6: -28 refs, bootstrap refs: 3
Loop #7: -33 refs, bootstrap refs: 2
Loop #8: -38 refs, bootstrap refs: 1
Loop #9: -43 refs, bootstrap refs: 0
Loop #10: -48 refs, bootstrap refs: 99989


After I changed unmarshal_frozen_code() to "return Py_NewRef(code);", the 
reference count of the frozen bootstrap module stays stable, but total refcount 
increases over time:

Loop #1: 10 refs, bootstrap refs: 9
Loop #2: 18 refs, bootstrap refs: 9
Loop #3: 26 refs, bootstrap refs: 9
Loop #4: 34 refs, bootstrap refs: 9
Loop #5: 42 refs, bootstrap refs: 9
Loop #6: 50 refs, bootstrap refs: 9
Loop #7: 58 refs, bootstrap refs: 9
Loop #8: 66 refs, bootstrap refs: 9
Loop #9: 74 refs, bootstrap refs: 9

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable

2022-01-27 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

Thanks, Jason! I've submitted 
https://github.com/python/importlib_metadata/pull/365

> What's the harm in leaving this attribute on a class that is itself standing 
> in for deprecated behavior and slated for removal?

I think it does not do much harm, but there are several things that it affects:
1. Typing, we have to annotate it in typeshed, or write a custom ignore rule 
for our test suite
2. It is listed in `help()`:

```
 |  --
 |  Data and other attributes defined here:
 |  
 |  __hash__ = None
 |  
 |  method_name = 'sort'
 |  
 |  --
```

3. It is also in `dir(importlib.metadata.DeprecatedList)`

So, even if we remove this class in some time, we still should care about it 
until the removal :)

I am going to close this as "third party".

--
resolution:  -> third party
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46550] __slots__ updates despite being read-only

2022-01-27 Thread Ian Lee

New submission from Ian Lee :

Hi there - I admit that I don't really understand the internals here, so maybe 
there is a good reason for this, but I thought it was weird when I just ran 
across it. 

If I create a new class `A`, and set it's `__slots`:

```python
➜  ~ docker run -it python:3.10
Python 3.10.2 (main, Jan 26 2022, 20:07:09) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> class A(object):
... __slots__ = ["foo"]
...
>>> A.__slots__
['foo']
```


If I then go to add a new attribute to extend it on the class, that works:

```python
>>> A.__slots__ += ["bar"]
>>> A.__slots__
['foo', 'bar']
```

But then if I create an instance of that class, and try to update `__slots__` 
on that instnace, I get an AttributeError that `__slots__` is read-only, and 
yet it still is updating the `__slots__` variable:

```python
>>> a = A()
>>> a.__slots__
['foo', 'bar']

>>> a.__slots__ += ["baz"]
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'A' object attribute '__slots__' is read-only

>>> a.__slots__
['foo', 'bar', 'baz']
>>> A.__slots__
['foo', 'bar', 'baz']
```

Maybe there is a good reason for this, but I was definitely surprised that I 
would get a "this attribute is read-only" error, and yet still see that 
attribute updated.

I first found this in python 3.8.5, but I also tested using docker to generate 
the above example using docker python:3.10 which gave me python 3.10.2.

Cheers!

--
components: Library (Lib)
messages: 411886
nosy: IanLee1521
priority: normal
severity: normal
status: open
title: __slots__ updates despite being read-only
type: behavior
versions: Python 3.10, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46285] protocol_version in http.server.test can be ignored

2022-01-27 Thread Éric Araujo

Éric Araujo  added the comment:

There is no bug with partial itself.  I have tried to explain this and I can’t 
write it in another way.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46551] Provide number of workers option for fast PGO build time

2022-01-27 Thread Dong-hee Na


New submission from Dong-hee Na :

Compiling CPython with the PGO option is good for CPython performance but 
compile time is very painful since PGO profiling is executed with a single 
thread.

When I tested with run -m test --pgo -j8, it doesn't affect to optimized result 
with fast build time.

so I would like to provide the option for the number of workers for PGO build. 
and also with this feature, we can include more PGO tests more aggressively.

@vstinner, Do you have any suggestions for this option?
- a: ./configure --enable-optimizations --pgo-workers=8
- b: ./configure --enable-optimizations --with-concurrent-pgo
- c: ./configure --enable-optimizations (By detecting system cpu count)

Following metrics is the reference for decision making :)

## Build Time
AS-IS:
real4m42.799s

TO-BE(this case -j8): 
real2m10.405s

## No performance regression
I didn't check how the environment is reliable but there looks no regression.
++-+---+
| Benchmark  | base| workers   |
++=+===+
| 2to3   | 409 ms  | 412 ms: 1.01x slower  |
++-+---+
| chaos  | 115 ms  | 114 ms: 1.01x faster  |
++-+---+
| deltablue  | 6.66 ms | 6.59 ms: 1.01x faster |
++-+---+
| fannkuch   | 605 ms  | 611 ms: 1.01x slower  |
++-+---+
| float  | 138 ms  | 129 ms: 1.07x faster  |
++-+---+
| go | 220 ms  | 215 ms: 1.02x faster  |
++-+---+
| hexiom | 10.3 ms | 10.1 ms: 1.02x faster |
++-+---+
| json_dumps | 19.6 ms | 19.2 ms: 1.02x faster |
++-+---+
| json_loads | 40.6 us | 39.7 us: 1.02x faster |
++-+---+
| logging_silent | 180 ns  | 173 ns: 1.04x faster  |
++-+---+
| logging_simple | 8.89 us | 8.81 us: 1.01x faster |
++-+---+
| nqueens| 134 ms  | 136 ms: 1.01x slower  |
++-+---+
| pathlib| 24.6 ms | 24.2 ms: 1.01x faster |
++-+---+
| pickle | 16.1 us | 15.9 us: 1.01x faster |
++-+---+
| pickle_dict| 41.4 us | 38.1 us: 1.09x faster |
++-+---+
| pickle_list| 6.27 us | 5.09 us: 1.23x faster |
++-+---+
| pickle_pure_python | 499 us  | 492 us: 1.01x faster  |
++-+---+
| pidigits   | 285 ms  | 290 ms: 1.02x slower  |
++-+---+
| python_startup | 12.1 ms | 12.2 ms: 1.01x slower |
++-+---+
| python_startup_no_site | 8.91 ms | 8.89 ms: 1.00x faster |
++-+---+
| raytrace   | 510 ms  | 500 ms: 1.02x faster  |
++-+---+
| regex_compile  | 211 ms  | 210 ms: 1.00x faster  |
++-+---+
| regex_effbot   | 4.99 ms | 4.88 ms: 1.02x faster |
++-+---+
| regex_v8   | 37.3 ms | 36.3 ms: 1.03x faster |
++-+---+
| richards   | 73.6 ms | 72.2 ms: 1.02x faster |
++-+---+
| scimark_fft| 542 ms  | 552 ms: 1.02x slower  |
++-+---+
| scimark_lu | 189 ms  | 184 ms: 1.03x faster  |
++-+---+
| scimark_monte_carlo| 106 ms  | 106 ms: 1.01x slower  |
++-+---+
| scimark_sor| 199 ms  | 196 ms: 1.01x faster  |
++-+---+
| spectral_norm  | 177 ms  | 176 ms: 1.01x faster  |
++-+---+
| unpack_sequence| 64.9 ns | 63.7 ns: 1.02x faster |
++-+---+
| unpickle   | 21.5 us | 21.6 us: 1.00x slower |
+--

[issue46550] __slots__ updates despite being read-only

2022-01-27 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

It does not happen on `3.11` (main):

```
Python 3.11.0a4+ (heads/main-dirty:ef3ef6fa43, Jan 20 2022, 20:48:25) [Clang 
11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class A:
...   __slots__ = ('x',)
... 
>>> A.__slots__ += ('y',)
>>> A.__slots__
('x', 'y')

>>> a = A()
>>> a.__slots__ 
('x', 'y')
>>> a.__slots__ += ('z',)
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'A' object attribute '__slots__' is read-only

>>> a.__slots__
('x', 'y')
```

It also does not happen on `3.9`:

```
Python 3.9.9 (main, Dec 21 2021, 11:35:28) 
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class A:
...   __slots__ = ('x',)
... 
>>> a = A()
>>> a.__slots__ += ('y',)
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'A' object attribute '__slots__' is read-only

>>> a.__slots__
('x',)
```

--
nosy: +sobolevn

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46550] __slots__ updates despite being read-only

2022-01-27 Thread Ian Lee


Ian Lee  added the comment:

@sobolevn - Hmm, interesting.. I tested in python 3.9 which I had available, 
and I can reproduce your result, but I think it's different because you are 
using a tuple. If I use a list then I see my same reported behavior in 3.9:


```python
Python 3.9.10 (main, Jan 26 2022, 20:56:53)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class A:
... __slots__ = ('x',)
...
>>> a = A()
>>> a.__slots__
('x',)
>>> a.__slots__ += ('y',)
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'A' object attribute '__slots__' is read-only
>>> a.__slots__
('x',)
>>>
>>>
>>>
>>> class B:
... __slots__ = ['x']
...
>>> b = B()
>>> b.__slots__
['x']
>>> b.__slots__ += ['y']
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'B' object attribute '__slots__' is read-only
>>> b.__slots__
['x', 'y']
```

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46535] Possible bug: pdb causes exception

2022-01-27 Thread Stefan Ecklebe


Change by Stefan Ecklebe :


--
type: crash -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46550] __slots__ updates despite being read-only

2022-01-27 Thread Eryk Sun


Eryk Sun  added the comment:

Please read about augmented assignment [1]. In the REPL, use help("+=").

An augmented assignment evaluates the target (which, unlike normal
assignment statements, cannot be an unpacking) and the expression
list, performs the binary operation specific to the type of
assignment on the two operands, and assigns the result to the
original target. The target is only evaluated once.

An augmented assignment expression like x += 1 can be rewritten as
x = x + 1 to achieve a similar, but not exactly equal effect. In
the augmented version, x is only evaluated once. Also, when
possible, the actual operation is performed in-place, meaning that
rather than creating a new object and assigning that to the target,
the old object is modified instead.

Unlike normal assignments, augmented assignments evaluate the left-
hand side before evaluating the right-hand side. For example,
a[i] += f(x) first looks-up a[i], then it evaluates f(x) and
performs the addition, and lastly, it writes the result back to
a[i].

---
[1] 
https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46551] Provide number of workers option for fast PGO build time

2022-01-27 Thread STINNER Victor


STINNER Victor  added the comment:

> When I tested with run -m test --pgo -j8, it doesn't affect to optimized 
> result with fast build time.

You only test libregrtest.main and libregrtest.runtest_mp modules which don't 
execute code. Does it mean that running tests is useless to train the PGO?

Or does PGO magically aggregates results when multiple processes are run?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7057] tkinter doc: more 3.x updates

2022-01-27 Thread Zachary Ware


Zachary Ware  added the comment:

Trusting Mark's diagnosis, I'm closing the issue.

--
nosy: +zach.ware
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10943] abitype: Need better support to port C extension modules to the stable C API

2022-01-27 Thread Zachary Ware


Zachary Ware  added the comment:

Tools/scripts/abitype.py hasn't seen much maintenance in 11 years, but it also 
seems not to have seen much use.  Patches would be accepted, but priority is 
low enough that I'm going to go ahead and close the issue.

--
nosy: +zach.ware
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29844] Windows Python installers not installing DLL to System32/SysWOW64

2022-01-27 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +29141
pull_request: https://github.com/python/cpython/pull/30962

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29844] Windows Python installers not installing DLL to System32/SysWOW64

2022-01-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29142
pull_request: https://github.com/python/cpython/pull/30963

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29844] Windows Python installers not installing DLL to System32/SysWOW64

2022-01-27 Thread Zachary Ware


Zachary Ware  added the comment:

With the readme updated (and backports in progress), I'm closing the issue.

--
nosy:  -miss-islington
resolution:  -> fixed
stage: patch review -> needs patch
status: open -> closed
versions: +Python 3.11 -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46539] typing: forward references don't understand special type forms

2022-01-27 Thread miss-islington


miss-islington  added the comment:


New changeset 37577033baadf5f4a30d0998bae7d26f11a694e2 by Miss Islington (bot) 
in branch '3.9':
bpo-46539: Pass status of special typeforms to forward references (GH-30926)
https://github.com/python/cpython/commit/37577033baadf5f4a30d0998bae7d26f11a694e2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46539] typing: forward references don't understand special type forms

2022-01-27 Thread miss-islington


miss-islington  added the comment:


New changeset bfcb41420a326ec353740d8180ffbf402746fa33 by Miss Islington (bot) 
in branch '3.10':
bpo-46539: Pass status of special typeforms to forward references (GH-30926)
https://github.com/python/cpython/commit/bfcb41420a326ec353740d8180ffbf402746fa33


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46551] Provide number of workers option for fast PGO build time

2022-01-27 Thread Dong-hee Na


Dong-hee Na  added the comment:

> You only test libregrtest.main and libregrtest.runtest_mp modules which > 
> don't execute code. Does it mean that running tests is useless to train > the 
> PGO?

Sorry, I didn't check all affects except performance regression,
and there was already related discussion and decided not to do:
https://bugs.python.org/issue24915#msg251128
'I think the --pgo flag needs only work in single process mode, since
multi-process would probably not write out the profiling data properly.'

I close the issue as won't do.

--
assignee: corona10 -> 
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29844] Windows Python installers not installing DLL to System32/SysWOW64

2022-01-27 Thread Zachary Ware


Zachary Ware  added the comment:


New changeset a8912a0f8d9eba6d502c37d51f9933e976db by Miss Islington (bot) 
in branch '3.10':
bpo-29844: Remove obsolete paragraph from Tools/msi/README.txt (GH-29141)
https://github.com/python/cpython/commit/a8912a0f8d9eba6d502c37d51f9933e976db


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29844] Windows Python installers not installing DLL to System32/SysWOW64

2022-01-27 Thread Zachary Ware


Zachary Ware  added the comment:


New changeset 7c8d1f0238842fb8da099e797eea5973b66638a9 by Miss Islington (bot) 
in branch '3.9':
bpo-29844: Remove obsolete paragraph from Tools/msi/README.txt (GH-29141)
https://github.com/python/cpython/commit/7c8d1f0238842fb8da099e797eea5973b66638a9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46378] Experiment with LLVM BOLT binary optimizer

2022-01-27 Thread Dong-hee Na


Dong-hee Na  added the comment:

Only 1% gain, so we decided not to adopt it yet.
see: https://github.com/faster-cpython/ideas/issues/224#issuecomment-1022371595

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-01-27 Thread Henry Schreiner


Henry Schreiner  added the comment:

It would be great to get this looked at before things start getting too locked 
in for 3.11!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44791] Substitution of ParamSpec in Concatenate

2022-01-27 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
nosy: +Jelle Zijlstra

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2022-01-27 Thread STINNER Victor


STINNER Victor  added the comment:

I used the following shell command to search remaining static types:
---
grep -E 'static PyTypeObject [a-zA-Z_0-9]+ *(;|= *{|) *$' $(find -name "*.c")
---

I found 86 static types in 17 files:

* PC/_msi.c:

  * msidb_Type
  * msiview_Type
  * record_Type
  * summary_Type

* Modules/_ctypes/_ctypes.c:

  * DictRemover_Type
  * PyComError_Type
  * PyDec_Type
  * Simple_Type
  * StructParam_Type
  * Struct_Type
  * UnionType_Type
  * Union_Type

* Modules/_decimal/_decimal.c:

  * PyDecContextManager_Type
  * PyDecContext_Type
  * PyDecSignalDict_Type

* Modules/xxmodule.c:

  * Null_Type
  * Str_Type
  * Xxo_Type

* Modules/_testbuffer.c:

  * NDArray_Type
  * StaticArray_Type

* Modules/itertoolsmodule.c (multiphase init):

  * _grouper_type
  * accumulate_type
  * combinations_type
  * compress_type
  * count_type
  * cwr_type
  * cycle_type
  * dropwhile_type
  * filterfalse_type
  * groupby_type
  * pairwise_type
  * permutations_type
  * starmap_type
  * takewhile_type
  * tee_type
  * teedataobject_type

* Modules/_xxsubinterpretersmodule.c:

  * ChannelIDtype

* Modules/_datetimemodule.c:

  * PyDateTime_DateTimeType
  * PyDateTime_DateType
  * PyDateTime_DeltaType
  * PyDateTime_IsoCalendarDateType
  * PyDateTime_TZInfoType
  * PyDateTime_TimeType
  * PyDateTime_TimeZoneType

* Modules/_testcapimodule.c:

  * ContainerNoGC_type
  * GenericAlias_Type
  * Generic_Type
  * MethClass_Type
  * MethInstance_Type
  * MethStatic_Type
  * MethodDescriptor2_Type
  * MethodDescriptorBase_Type
  * MethodDescriptorDerived_Type
  * MethodDescriptorNopGet_Type
  * MyList_Type
  * PyRecursingInfinitelyError_Type
  * _HashInheritanceTester_Type
  * awaitType
  * ipowType
  * matmulType
  * test_structmembersType

* Modules/_zoneinfo.c:

  * PyZoneInfo_ZoneInfoType

* Modules/ossaudiodev.c:

  * OSSAudioType
  * OSSMixerType

* Modules/socketmodule.c:

  * sock_type

* Modules/xxsubtype.c:

  * spamdict_type
  * spamlist_type

* Modules/_collectionsmodule.c:

  * defdict_type
  * deque_type
  * dequeiter_type
  * dequereviter_type
  * tuplegetter_type

* Modules/_elementtree.c:

  * ElementIter_Type
  * Element_Type
  * TreeBuilder_Type
  * XMLParser_Type

* Modules/_pickle.c:

  * Pdata_Type
  * PicklerMemoProxyType
  * Pickler_Type
  * UnpicklerMemoProxyType
  * Unpickler_Type

* Modules/_asynciomodule.c:

  * FutureIterType
  * FutureType
  * PyRunningLoopHolder_Type
  * TaskStepMethWrapper_Type
  * TaskType

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2022-01-27 Thread STINNER Victor


STINNER Victor  added the comment:

And I found 135 more static types with this command:
---
grep -E '^PyTypeObject [a-zA-Z_0-9]+ *(;|= *{|) *$' $(find -name "*.c")
---

Types:

Objects/cellobject.c: PyCell_Type
Objects/sliceobject.c: PyEllipsis_Type
Objects/sliceobject.c: PySlice_Type
Objects/unionobject.c: _PyUnion_Type
Objects/methodobject.c: PyCFunction_Type
Objects/methodobject.c: PyCMethod_Type
Objects/picklebufobject.c: PyPickleBuffer_Type
Objects/boolobject.c: PyBool_Type
Objects/bytearrayobject.c: PyByteArray_Type
Objects/bytearrayobject.c: PyByteArrayIter_Type
Objects/classobject.c: PyMethod_Type
Objects/classobject.c: PyInstanceMethod_Type
Objects/fileobject.c: PyStdPrinter_Type
Objects/genericaliasobject.c: Py_GenericAliasType
Objects/interpreteridobject.c: _PyInterpreterID_Type
Objects/iterobject.c: PySeqIter_Type
Objects/iterobject.c: PyCallIter_Type
Objects/iterobject.c: _PyAnextAwaitable_Type
Objects/moduleobject.c: PyModuleDef_Type
Objects/moduleobject.c: PyModule_Type
Objects/rangeobject.c: PyRange_Type
Objects/rangeobject.c: PyRangeIter_Type
Objects/rangeobject.c: PyLongRangeIter_Type
Objects/namespaceobject.c: _PyNamespace_Type
Objects/bytesobject.c: PyBytes_Type
Objects/bytesobject.c: PyBytesIter_Type
Objects/capsule.c: PyCapsule_Type
Objects/complexobject.c: PyComplex_Type
Objects/dictobject.c: PyDict_Type
Objects/dictobject.c: PyDictIterKey_Type
Objects/dictobject.c: PyDictIterValue_Type
Objects/dictobject.c: PyDictIterItem_Type
Objects/dictobject.c: PyDictRevIterKey_Type
Objects/dictobject.c: PyDictRevIterItem_Type
Objects/dictobject.c: PyDictRevIterValue_Type
Objects/dictobject.c: PyDictKeys_Type
Objects/dictobject.c: PyDictItems_Type
Objects/dictobject.c: PyDictValues_Type
Objects/floatobject.c: PyFloat_Type
Objects/frameobject.c: PyFrame_Type
Objects/funcobject.c: PyFunction_Type
Objects/funcobject.c: PyClassMethod_Type
Objects/funcobject.c: PyStaticMethod_Type
Objects/memoryobject.c: _PyManagedBuffer_Type
Objects/memoryobject.c: PyMemoryView_Type
Objects/odictobject.c: PyODict_Type
Objects/odictobject.c: PyODictIter_Type
Objects/odictobject.c: PyODictKeys_Type
Objects/odictobject.c: PyODictItems_Type
Objects/odictobject.c: PyODictValues_Type
Objects/setobject.c: PySetIter_Type
Objects/setobject.c: PySet_Type
Objects/setobject.c: PyFrozenSet_Type
Objects/setobject.c: _PySetDummy_Type
Objects/tupleobject.c: PyTuple_Type
Objects/tupleobject.c: PyTupleIter_Type
Objects/object.c: _PyNone_Type
Objects/object.c: _PyNotImplemented_Type
Objects/unicodeobject.c: PyUnicode_Type
Objects/unicodeobject.c: PyUnicodeIter_Type
Objects/listobject.c: PyList_Type
Objects/listobject.c: PyListIter_Type
Objects/listobject.c: PyListRevIter_Type
Objects/genobject.c: PyGen_Type
Objects/genobject.c: PyCoro_Type
Objects/genobject.c: _PyCoroWrapper_Type
Objects/genobject.c: PyAsyncGen_Type
Objects/genobject.c: _PyAsyncGenASend_Type
Objects/genobject.c: _PyAsyncGenWrappedValue_Type
Objects/genobject.c: _PyAsyncGenAThrow_Type
Objects/longobject.c: PyLong_Type
Objects/descrobject.c: PyMethodDescr_Type
Objects/descrobject.c: PyClassMethodDescr_Type
Objects/descrobject.c: PyMemberDescr_Type
Objects/descrobject.c: PyGetSetDescr_Type
Objects/descrobject.c: PyWrapperDescr_Type
Objects/descrobject.c: _PyMethodWrapper_Type
Objects/descrobject.c: PyDictProxy_Type
Objects/descrobject.c: PyProperty_Type
Objects/enumobject.c: PyEnum_Type
Objects/enumobject.c: PyReversed_Type
Objects/codeobject.c: _LineIterator
Objects/codeobject.c: _PositionsIterator
Objects/codeobject.c: PyCode_Type
Objects/typeobject.c: PyType_Type
Objects/typeobject.c: PyBaseObject_Type
Objects/typeobject.c: PySuper_Type
Python/bltinmodule.c: PyFilter_Type
Python/bltinmodule.c: PyMap_Type
Python/bltinmodule.c: PyZip_Type
Python/context.c: PyContext_Type
Python/context.c: PyContextVar_Type
Python/context.c: PyContextToken_Type
Python/context.c: _PyContextTokenMissing_Type
Python/hamt.c: _PyHamtItems_Type
Python/hamt.c: _PyHamtKeys_Type
Python/hamt.c: _PyHamtValues_Type
Python/hamt.c: _PyHamt_Type
Python/hamt.c: _PyHamt_ArrayNode_Type
Python/hamt.c: _PyHamt_BitmapNode_Type
Python/hamt.c: _PyHamt_CollisionNode_Type
Python/traceback.c: PyTraceBack_Type
Python/symtable.c: PySTEntry_Type
Modules/_ctypes/callproc.c: PyCArg_Type
Modules/_ctypes/_ctypes.c: PyCStructType_Type
Modules/_ctypes/_ctypes.c: PyCPointerType_Type
Modules/_ctypes/_ctypes.c: PyCArrayType_Type
Modules/_ctypes/_ctypes.c: PyCSimpleType_Type
Modules/_ctypes/_ctypes.c: PyCFuncPtrType_Type
Modules/_ctypes/_ctypes.c: PyCData_Type
Modules/_ctypes/_ctypes.c: PyCFuncPtr_Type
Modules/_ctypes/_ctypes.c: PyCArray_Type
Modules/_ctypes/_ctypes.c: PyCPointer_Type
Modules/_ctypes/cfield.c: PyCField_Type
Modules/_ctypes/stgdict.c: PyCStgDict_Type
Modules/_ctypes/callbacks.c: PyCThunk_Type
Modules/_io/iobase.c: PyIOBase_Type
Modules/_io/iobase.c: PyRawIOBase_Type
Modules/_io/stringio.c: PyStringIO_Type
Modules/_io/textio.c: PyTextIOBase_Type
Modules/_io/textio.c: PyIncrementalNewlineDecoder_Type
Modules/

[issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7

2022-01-27 Thread Zachary Ware


Zachary Ware  added the comment:

BTW, we do have an Alpine buildbot worker in the unstable set, running only on 
the `main` branch: https://buildbot.python.org/all/#/workers/19

--
nosy: +zach.ware

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-01-27 Thread Mark Shannon


Mark Shannon  added the comment:

Yes, we should expose the tuple of variable names, both in Python and in the 
C-API.

Would something like
`PyCodeObject_GetVariableName()` and `PyCodeObject_GetVariableKind()` work?


In the meantime, since you were reading `co_varnames` directly, why not read 
`co_localsplusnames` directly? 


OOI, how do you cope with non-local self?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2022-01-27 Thread STINNER Victor


STINNER Victor  added the comment:

> And I found 135 more static types with this command

Of these 135 static types, most are cleared since bpo-46417 was implemented:

* 103 types are cleared by _PyTypes_FiniTypes()
* 15 types are cleared by _PyIO_Fini()
* the remaining 17 types are not cleared at Python exit: types of _ctypes, 
_curses and _multiprocessing extensions

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-01-27 Thread Eric Snow


Eric Snow  added the comment:

In addition to what Mark said, note that co_varnames get's populated lazily by 
the Python-level getter for code.co_varnames.  So could you call the Python 
function before entering the hot path?

Regardless, a dedicated C-API for this like Mark suggested would be the better 
solution.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-27 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29143
pull_request: https://github.com/python/cpython/pull/30964

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread Mark Dickinson


Mark Dickinson  added the comment:

Low priority, but it may also be worth updating the implementation of 
`Vec2D.__abs__`. It currently looks like this:

def __abs__(self):
return (self[0]**2 + self[1]**2)**0.5

But would be more robust if it used hypot:

def __abs__(self):
return math.hypot(self[0], self[1])

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-01-27 Thread Eric Snow


Eric Snow  added the comment:


New changeset 247480a21cb165efdacc346a2d589dfc27e18283 by Eric Snow in branch 
'main':
bpo-46541: Generate the global objects initializer. (gh-30941)
https://github.com/python/cpython/commit/247480a21cb165efdacc346a2d589dfc27e18283


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread Mark Dickinson


Mark Dickinson  added the comment:

Apologies; looks like I'm out of date on this. It's already using hypot, which 
makes it more than a little worrying that it doesn't get the right answer for 
`Vec2D(6, 8)`.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread Mark Dickinson


Mark Dickinson  added the comment:

Sorry again, all; I failed to read everything that was going on here. The test 
*wasn't* failing with the hypot-based version of Vec2D.__abs__ that's in the 
main branch; only with the "**0.5"-based version that was still in the older 
branches. Please ignore this and the previous two messages ...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-27 Thread Christian Heimes


Change by Christian Heimes :


--
nosy: +christian.heimes
nosy_count: 6.0 -> 7.0
pull_requests: +29144
pull_request: https://github.com/python/cpython/pull/30965

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-01-27 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
keywords: +3.11regression
nosy: +gregory.p.smith
priority: normal -> high

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-27 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 26b0482393a313e3bda364a35e7417e9db52c1c4 by Christian Heimes in 
branch 'main':
bpo-46476: Simplify and fix _PyStaticCode_Dealloc (GH-30965)
https://github.com/python/cpython/commit/26b0482393a313e3bda364a35e7417e9db52c1c4


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42982] Update suggested number of iterations for pbkdf2_hmac()

2022-01-27 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +29145
pull_request: https://github.com/python/cpython/pull/30966

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >