[issue45476] [C API] Disallow using PyFloat_AS_DOUBLE() as l-value

2021-11-14 Thread Oleg Iarygin
Oleg Iarygin added the comment: Marc-Andre: > Inlining is something that is completely under the control of the used compilers. Compilers are free to not inline function marked for inlining [...] I checked the following C snippet on gcc.godbolt.org using GCC 4.1.2 and Clang 3.0.0 with

[issue45512] [sqlite3] simplify "isolation level"

2021-11-14 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset b567b9d74bd9e476a3027335873bb0508d6e450f by Erlend Egeberg Aasland in branch 'main': bpo-45512: Simplify isolation_level handling in `sqlite3` (GH-29053) https://github.com/python/cpython/commit/b567b9d74bd9e476a3027335873bb0508d6e450f

[issue37295] Possible optimizations for math.comb()

2021-11-14 Thread Stefan Pochmann
Stefan Pochmann added the comment: Turns out for n=100_000, k=50_000, about 87% of my factors are 1, so they don't even need to be turned into Python ints for multiplication, improving the multiplication part to 3.05 ms. And a C++ version to produce the factors took 0.85 ms. Updated

[issue45806] Cannot Recover From StackOverflow in 3.9 Tests

2021-11-14 Thread David Bolen
Change by David Bolen : -- nosy: +db3l ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30570] issubclass segfaults on objects with weird __getattr__

2021-11-14 Thread Dennis Sweeney
Dennis Sweeney added the comment: Since this isn't quite related to the original issue, I opened bpo-45806 to discuss. -- ___ Python tracker ___

[issue45806] Cannot Recover From StackOverflow in 3.9 Tests

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

[issue37295] Possible optimizations for math.comb()

2021-11-14 Thread Stefan Pochmann
Stefan Pochmann added the comment: And for Raymond's case 4), about running very long and not responding to SIGINT, with n=1_000_000 and k=500_000: 150.91 seconds math.comb(n, k) 39.11 seconds factorial(n) // (factorial(k) * factorial(n-k)) 0.40 seconds mycomb(n, k) 0.14 seconds

[issue37295] Possible optimizations for math.comb()

2021-11-14 Thread Stefan Pochmann
Stefan Pochmann added the comment: I wrote a Python solution ("mycomb") that computes comb(100_000, 50_000) faster, maybe of interest: 1510.4 ms math.comb(n, k) 460.8 ms factorial(n) // (factorial(k) * factorial(n-k)) 27.5 ms mycomb(n, k) 6.7 ms *estimation* for mycomb if written

[issue15500] Python should support exporting thread names to the OS

2021-11-14 Thread Eryk Sun
Eryk Sun added the comment: Zackery, here's an initial draft implementation for Windows 10+ that's based on the interface you created in PR 14578. It calls WinAPI SetThreadDescription(), which sets the thread's name directly in the kernel thread object (i.e. ETHREAD.ThreadName). This

[issue26175] Fully implement IOBase abstract on SpooledTemporaryFile

2021-11-14 Thread Carey
Change by Carey : -- nosy: +pR0Ps nosy_count: 6.0 -> 7.0 pull_requests: +27808 pull_request: https://github.com/python/cpython/pull/29560 ___ Python tracker ___

[issue25625] "chdir" Contex manager for pathlib

2021-11-14 Thread Cameron Simpson
Cameron Simpson added the comment: On 15Nov2021 01:04, Python Bug Reports wrote: >Can you share the link? I haven't seen anything recent. Is it under >other thread? It's in the discuss-ideas part of discuss.python.org during a discussions about a possible new context manager to atomically

[issue25625] "chdir" Contex manager for pathlib

2021-11-14 Thread Filipe Laíns
Filipe Laíns added the comment: Can you share the link? I haven't seen anything recent. Is it under other thread? -- ___ Python tracker ___

[issue25625] "chdir" Contex manager for pathlib

2021-11-14 Thread Éric Araujo
Éric Araujo added the comment: There is renewed discussion on python-dev about placing this in contextlib. -- nosy: +eric.araujo ___ Python tracker ___

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45650] cgitb does not emit CGI headers when format='text'

2021-11-14 Thread Eric V. Smith
Change by Eric V. Smith : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44743] asyncio DatagramProtocol stops calling callbacks after OSError

2021-11-14 Thread Szymon
Szymon added the comment: I'm experiencing the same exact issue. The bug manifests with all combinations: SelectorEventLoop and ProactorEventLoop, python 3.9 and 3.10, on Windows 10. Python 3.8 on Linux seems to not be affected. Can we get a fix or at least an update? -- nosy:

[issue45573] Use pkg-config autoconf macros to detect flags for Modules/Setup

2021-11-14 Thread Christian Heimes
Christian Heimes added the comment: New changeset c3997865f24d9491318b401ae8e46d27332aca25 by Christian Heimes in branch 'main': bpo-45573: Use Makefile's dependencies in setup.py (GH-29559) https://github.com/python/cpython/commit/c3997865f24d9491318b401ae8e46d27332aca25 --

[issue30570] issubclass segfaults on objects with weird __getattr__

2021-11-14 Thread David Bolen
David Bolen added the comment: So I'm guessing something is just borderline under 3.9 on Windows. In some manual testing with a standalone build of 3.9 so far for me: -m test.test_pickle always succeeds (executed directly) -m test test_pickle always fails (executed via

[issue45573] Use pkg-config autoconf macros to detect flags for Modules/Setup

2021-11-14 Thread Christian Heimes
Change by Christian Heimes : -- pull_requests: +27807 pull_request: https://github.com/python/cpython/pull/29559 ___ Python tracker ___

[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-14 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: Works for me as well. Thanks. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue30570] issubclass segfaults on objects with weird __getattr__

2021-11-14 Thread David Bolen
David Bolen added the comment: I don't know if this is a buildbot, test or 3.9-specific issue but this commit appears to have introduced a permanent initial failure (but success on retry) in test_pickle on both Windows 10 3.9 builders. First failure for my builder at

[issue45804] IDLE - faster shell writing

2021-11-14 Thread Roger Serwy
Roger Serwy added the comment: All good questions, Terry! I do have a git clone of the cpython repo, but I haven't worked through the new commit/patch process since Mercurial. I'm a bit rusty. The buffering provided is for calls to `write`. It does not do any line buffering. Calls to

[issue45742] python -h can't find -R option

2021-11-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: If you two agree on an exact wording, I can make the PR and backport. -- ___ Python tracker ___

[issue44532] multi subinterpreters use _PyStructSequence_InitType failed.

2021-11-14 Thread Hai Shi
Hai Shi added the comment: OK,thanks. If it's just only interal calling, I don't think throwing a exception would break anything. As your pasted code shows, the modules have judeged the tp_name is inited or not. -- ___ Python tracker

[issue45650] cgitb does not emit CGI headers when format='text'

2021-11-14 Thread Eric V. Smith
Eric V. Smith added the comment: I would think the use case for 'text' is to not print the output to a web page, so you wouldn't want the headers. The documentation says that cgitb was generalized to not only produce output for web pages. The 'text' format provides this generalization.

[issue45796] Using tab to cycle through tkinter widgets breaks foreground styling

2021-11-14 Thread E. Paine
E. Paine added the comment: I believe this is just because the `selectbackground` is only shown when the widget has focus. Try, for example, only selecting part of the text and then tabbing off. Therefore, I think this is not a bug. The only thing which makes me slightly doubt myself is

[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-14 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-14 Thread PEW's Corner
PEW's Corner added the comment: Seems to work. Thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21644] Optimize bytearray(int) constructor to use calloc()

2021-11-14 Thread Bruce Merry
Bruce Merry added the comment: > I abandonned the issue because I didn't have time to work on it. If you want, > you can open a new issue for that. If I make a pull request and run some microbenchmarks, will you (or some other core dev) have time to review it? I've had a bad experience

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington
miss-islington added the comment: New changeset 9f9a3028e3bb923e726789ab3ea5ce298b596bc6 by Miss Islington (bot) in branch '3.9': bpo-45752: Remove "array" from list of things that cannot be copied in `copy` module docstring (GH-29555)

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington
miss-islington added the comment: New changeset 55d24edaadba4ee90f464d88b44075649788f128 by Miss Islington (bot) in branch '3.10': bpo-45752: Remove "array" from list of things that cannot be copied in `copy` module docstring (GH-29555)

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington
Change by miss-islington : -- pull_requests: +27806 pull_request: https://github.com/python/cpython/pull/29558 ___ Python tracker ___

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington
Change by miss-islington : -- pull_requests: +27805 pull_request: https://github.com/python/cpython/pull/29557 ___ Python tracker ___

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington
miss-islington added the comment: New changeset c2c4fdf5ea6e9cba4ef469d08a52abb9cfa756a5 by Alex Waygood in branch 'main': bpo-45752: Remove "array" from list of things that cannot be copied in `copy` module docstring (GH-29555)

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington
miss-islington added the comment: New changeset 2081f9fe75a3a990394fbccd0c1c91c229c6289e by M. Mostafa Farzan in branch '3.10': [3.10] bpo-45752: Fix no-support examples in 'copy' docs (GH-29548) (GH-29556) https://github.com/python/cpython/commit/2081f9fe75a3a990394fbccd0c1c91c229c6289e

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread Mohammad Mostafa Farzan
Change by Mohammad Mostafa Farzan : -- pull_requests: +27804 pull_request: https://github.com/python/cpython/pull/29556 ___ Python tracker ___

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread Alex Waygood
Change by Alex Waygood : -- nosy: +AlexWaygood nosy_count: 7.0 -> 8.0 pull_requests: +27803 pull_request: https://github.com/python/cpython/pull/29555 ___ Python tracker ___

[issue45742] python -h can't find -R option

2021-11-14 Thread Eryk Sun
Eryk Sun added the comment: How about this? Enable hash randomization. This option overrides PYTHONHASHSEED to use the default behavior. -- ___ Python tracker ___

[issue45742] python -h can't find -R option

2021-11-14 Thread STINNER Victor
STINNER Victor added the comment: If I understand correctly https://docs.python.org/3.10/using/cmdline.html#cmdoption-R "This option only has an effect if the PYTHONHASHSEED environment variable is set to 0" should be replaced with: "This option only has an effect if the PYTHONHASHSEED

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington
miss-islington added the comment: New changeset 6073920fcdb5a36d20a6a7c6ee204f74f00e1cb4 by Miss Islington (bot) in branch '3.9': bpo-45752: Fix no-support examples in 'copy' docs (GH-29548) https://github.com/python/cpython/commit/6073920fcdb5a36d20a6a7c6ee204f74f00e1cb4 --

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +27802 pull_request: https://github.com/python/cpython/pull/29554 ___ Python tracker

[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset b7360ae395e9e633d384d16064c5dc04a9841e19 by M. Mostafa Farzan in branch 'main': bpo-45752: Fix no-support examples in 'copy' docs (GH-29548) https://github.com/python/cpython/commit/b7360ae395e9e633d384d16064c5dc04a9841e19 -- nosy:

[issue45800] Move expat handling into configure and Makefile

2021-11-14 Thread Christian Heimes
Christian Heimes added the comment: New changeset 464e6616be86129e33af6d9e43540c260d6804d5 by Christian Heimes in branch 'main': bpo-45800: Move pyexpat build setup into configure (GH-29547) https://github.com/python/cpython/commit/464e6616be86129e33af6d9e43540c260d6804d5 --

[issue45800] Move expat handling into configure and Makefile

2021-11-14 Thread Christian Heimes
Change by Christian Heimes : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-14 Thread Saul Shanabrook
Saul Shanabrook added the comment: Actually, keeping this open. I am still unclear if this is expected behavior or not, but I do notice that the dis module is unable to read the flag when the annotations future is imported. For example `dis.pretty_flags(compile("from __future__ import

[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-14 Thread Saul Shanabrook
Saul Shanabrook added the comment: I am closing this because, I realized I was unclear on whether the future flags end up as code flags. I thought we were just missing this one, but then realized that none of the other future flags are documented either. I had found a flag that was not

[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-14 Thread Saul Shanabrook
New submission from Saul Shanabrook : The CO_FUTURE_ANNOTATIONS code flag was added in Python 3.7 I believe in this PR https://github.com/python/cpython/pull/4390. However, it does not appear in dis's COMPILER_FLAG_NAMES map and so is not documented in inspect or pretty printed. I believe