[issue42914] pprint numbers with underscore

2021-01-12 Thread Felipe
New submission from Felipe : It would be nice if pprint learned to insert underscores in long numbers Current behavior: >>> pprint.pprint(int(1e9)) 10 Desired behavior >>> pprint.pprint(int(1e9)) 1_000_000_000 Wikipedia tells me that "groups of 3" is the international standard to

[issue25988] collections.abc.Indexable

2021-01-12 Thread STINNER Victor
STINNER Victor added the comment: New changeset c47c78b878ff617164b2b94ff711a6103e781753 by Hugo van Kemenade in branch 'master': bpo-37324: Remove ABC aliases from collections (GH-23754) https://github.com/python/cpython/commit/c47c78b878ff617164b2b94ff711a6103e781753 --

[issue42917] Block stack size for frame objects should be dynamically sizable

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

[issue42889] Incorrect behavior of Python parser after ast node of test program being modified

2021-01-12 Thread Xinmeng Xia
Xinmeng Xia added the comment: Nice suggestion! I change the argument and I can' find segfault program in transforming ast.Name. But I do find a segfault program in transforming ast.BinOp! Seeing the following example, this program will cause a segmentation fault on Python 3.10. No error

[issue42880] ctypes: variadic function call still doesn't work on Apple Silicon

2021-01-12 Thread Ziqiao Kong
Ziqiao Kong added the comment: Hello, we do a clean reinstallation of Big Sur 11.1. The problem still exists: with brew-installed python3.9 ``` qiling@kamino /tmp % DYLD_PRINT_LIBRARIES=1 python3.9 test_main.py [...] dyld: loaded: <52918C9B-7E0B-3852-AB19-F74846BCAAF8>

[issue42882] Restarting the interpreter causes UB on 3.10.0a4

2021-01-12 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23024 pull_request: https://github.com/python/cpython/pull/24198 ___ Python tracker ___

[issue42902] a python embedded program may load "C:\Lib\os.py" on windows system

2021-01-12 Thread STINNER Victor
STINNER Victor added the comment: Python has an unit test on Py_SetPath(): test_embed.test_init_setpath. > Write following code that only call Py_Initialize(): (...) Do you mean that on Windows Python looks for modules in C:\Lib\ just by calling Py_Initialize()? > According to

[issue42880] ctypes: variadic function call still doesn't work on Apple Silicon

2021-01-12 Thread Ronald Oussoren
Ronald Oussoren added the comment: AFAIK you should specify the types of the fixed arguments for variadic functions. The ABI for the M1 has a different calling convention of the variadic arguments, the ctypes implementation counts how many variadic arguments there are based on the specified

[issue42903] optimize lru_cache for functions with no arguments

2021-01-12 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42882] Restarting the interpreter causes UB on 3.10.0a4

2021-01-12 Thread STINNER Victor
STINNER Victor added the comment: New changeset 44bf57aca627bd11a08b12fe4e4b6a0e1d268862 by Victor Stinner in branch 'master': bpo-42882: _PyRuntimeState_Init() leaves unicode next_index unchanged (GH-24193) https://github.com/python/cpython/commit/44bf57aca627bd11a08b12fe4e4b6a0e1d268862

[issue42902] a python embedded program may load "C:\Lib\os.py" on windows system

2021-01-12 Thread STINNER Victor
STINNER Victor added the comment: The reference documentation for the Python Path Configuration can be found at: https://docs.python.org/dev/c-api/init_config.html#python-path-configuration Currently, Py_SetPath(path) indirectly sets the following PyConfig members: * prefix = "" *

[issue42902] a python embedded program may load "C:\Lib\os.py" on windows system

2021-01-12 Thread Paul Moore
Paul Moore added the comment: I thought that *all* versions of Python located the standard library by searching for os.py... -- ___ Python tracker ___

[issue42902] a python embedded program may load "C:\Lib\os.py" on windows system

2021-01-12 Thread STINNER Victor
STINNER Victor added the comment: > I thought that *all* versions of Python located the standard library by > searching for os.py... The current implementation of the Python Path Configuration can be found in: * Windows: PC/getpathp.c * Unix: Modules/getpath.c It should be skipped if

[issue42906] python3 -m doctest test.py tests the stdlib "time" module instead

2021-01-12 Thread Stijn van Drongelen
New submission from Stijn van Drongelen : I have two files, named time.py and time_.py, with the same contents: def foo(): """Returns 1. >>> foo() 1 """ return 1 When I run python3 -m doctest -v time_.py I see the expected behaviour:

[issue42880] ctypes: variadic function call still doesn't work on Apple Silicon

2021-01-12 Thread Ziqiao Kong
Ziqiao Kong added the comment: I retry my cases with types specified and it works indeed. Maybe the documents should be updated for this case. Thanks a lot! -- ___ Python tracker

[issue42899] Regression __bool__ if AttributeError is raised (Possible regression introduced by bpo-42615)

2021-01-12 Thread STINNER Victor
Change by STINNER Victor : -- title: Possible regression introduced by bpo-42615 -> Regression __bool__ if AttributeError is raised (Possible regression introduced by bpo-42615) ___ Python tracker

[issue42882] Restarting the interpreter causes UB on 3.10.0a4

2021-01-12 Thread STINNER Victor
STINNER Victor added the comment: Thanks for your bug report, and thanks for testing alpha versions of Python! It's now fixed. But I didn't feel comfortable without a regression test. So I wrote PR 24198 to add an unit test on _PyUnicode_FromId() with multiple Python initializations.

[issue42899] Regression __bool__ if AttributeError is raised (Possible regression introduced by bpo-42615)

2021-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am not sure that it should be fixed. We already cut corners in similar cases and did this for years, and it always was okay. In the following example bool(a) is only called once: if a and b: f() 1 0 LOAD_NAME0

[issue42762] infinite loop resulted by "yield"

2021-01-12 Thread Steve Stagg
Steve Stagg added the comment: I don't believe this is a bug. You've discovered a nasty corner-case, but I think it's expected behaviour. There is a PEP open to make this behaviour a bit nicer: https://www.python.org/dev/peps/pep-0533/ The fact that older Python 3.5/6 versions don't get

[issue42882] Restarting the interpreter causes UB on 3.10.0a4

2021-01-12 Thread STINNER Victor
STINNER Victor added the comment: Ok, now I can safely close the issue ;-) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue42882] Restarting the interpreter causes UB on 3.10.0a4

2021-01-12 Thread STINNER Victor
STINNER Victor added the comment: New changeset 11d13e83abedabba12b28773317f1a365113e7af by Victor Stinner in branch 'master': bpo-42882: Add test_embed.test_unicode_id_init() (GH-24198) https://github.com/python/cpython/commit/11d13e83abedabba12b28773317f1a365113e7af --

[issue42906] python3 -m doctest test.py tests the stdlib "time" module instead

2021-01-12 Thread Stijn van Drongelen
Stijn van Drongelen added the comment: Reproducible in Python 3.8.7 and 3.9.1. -- versions: +Python 3.8, Python 3.9 ___ Python tracker ___

[issue42910] Wrong code appears in the type alias introduction

2021-01-12 Thread Casuall
New submission from Casuall : I learned about type aliases on the page(https://docs.python.org/3/library/typing.html), and I found that following the code (Vector = list[float])in the tutorial, an error occurred (NameError: name 'typing' is not defined) when running. The following code has

[issue41994] Refcount issues in import

2021-01-12 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 4db8988420e0a122d617df741381b0c385af032c by Serhiy Storchaka in branch 'master': bpo-41994: Fix refcount issues in Python/import.c (GH-22632) https://github.com/python/cpython/commit/4db8988420e0a122d617df741381b0c385af032c -- nosy:

[issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h

2021-01-12 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 187f76def8a5bd0af7ab512575cad30cfe624b05 by Petr Viktorin in branch '3.8': [3.8] bpo-40052: Fix alignment issue in PyVectorcall_Function() (GH-23999) (GH-24120) https://github.com/python/cpython/commit/187f76def8a5bd0af7ab512575cad30cfe624b05

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

2021-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For the latter, it was decided that it is legal a long time ago. It has a benefit and we did not have any complains for all these years. The absent of this optimization would encourage writing less readable code for performance. For the former, what is

[issue41994] Refcount issues in import

2021-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Petr! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue42910] Wrong code appears in the type alias introduction

2021-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What version of Python did you use? This is a documentation for Python 3.9. -- nosy: +serhiy.storchaka ___ Python tracker ___

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

2021-01-12 Thread Jurjen N.E. Bos
New submission from Jurjen N.E. Bos : When looking at the code of pow() with integer exponent, I noticed there is a hard boundary between the binary and "fiveary" (actually 32-ary) computations. Also, the fiveary wasn't really optimal. So I wrote a proof of concept version of long_pow that

[issue42843] What min_sphinx for Python 3.10

2021-01-12 Thread STINNER Victor
STINNER Victor added the comment: > Some distribs may want/need to ship Python 3.10 along with Sphinx 2? In my experience, Linux distributions prefer to only ship a single Sphinx version. The question is more which Linux distributions are stuck at Sphinx 2 only? If there is a short list of

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-12 Thread Paul Ganssle
Change by Paul Ganssle : -- keywords: +patch pull_requests: +23025 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24200 ___ Python tracker ___

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-12 Thread Paul Ganssle
Paul Ganssle added the comment: This particular grep statement is used to validate the `tzpath` variable. Apparently it is easy enough to achieve what I was going for using vanilla grep with no options, so I've created GH-24200 to fix the issue. I notice that there are other uses of `-q`

[issue42904] get_type_hints does not provide localns for classes

2021-01-12 Thread Ken Jin
Change by Ken Jin : -- keywords: +patch pull_requests: +23026 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24201 ___ Python tracker ___

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-12 Thread Martin Wheatley
Martin Wheatley added the comment: I'll do the test it happens with a plain ./configure Many thanks Martin On Tue, 12 Jan 2021 at 15:11, Paul Ganssle wrote: > > Paul Ganssle added the comment: > > This particular grep statement is used to validate the `tzpath` variable. > Apparently it

[issue42903] optimize lru_cache for functions with no arguments

2021-01-12 Thread Eugene Toder
Eugene Toder added the comment: @cache does not address the problem or any of the concerns brought up in the thread. Thread-safe @once is a nice idea, but more work of course. -- ___ Python tracker

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-12 Thread Martin Wheatley
Martin Wheatley added the comment: I'll do the test it happens with a plain ./configure Many thanks Martin On Tue, 12 Jan 2021 at 15:11, Paul Ganssle wrote: > > Paul Ganssle added the comment: > > This particular grep statement is used to validate the `tzpath` variable. > Apparently it

[issue42910] Wrong code appears in the type alias introduction

2021-01-12 Thread Casuall
Casuall added the comment: I am using python3.8, it turned out to be a version issue, sorry --原始邮件-- 发件人: "Python tracker"

[issue42910] Wrong code appears in the type alias introduction

2021-01-12 Thread Casuall
Change by Casuall : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42907] Division betwen float and 100 not giving corect result

2021-01-12 Thread Dimo Yordanov
New submission from Dimo Yordanov : To replicate what i think is a bug you need a python interpreter in any version. I think. When i type 2.7/100 it returns 0.027003, but it actually is 0.027 and 2.8/100 returns 0.027997. And i don't know why -- components:

[issue42907] Division betwen float and 100 not giving corect result

2021-01-12 Thread Dimo Yordanov
Dimo Yordanov added the comment: understandable. have a great day -- components: -Interpreter Core resolution: not a bug -> status: closed -> open versions: -Python 3.7 ___ Python tracker

[issue42907] Division betwen float and 100 not giving corect result

2021-01-12 Thread Christian Heimes
Change by Christian Heimes : -- resolution: -> not a bug status: open -> closed ___ Python tracker ___ ___ Python-bugs-list

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

2021-01-12 Thread Mark Shannon
Mark Shannon added the comment: The issue here is: Is it legal to convert if x: pass into pass ? The explicit effect of the code is unchanged, BUT the implicit effect (of calling x.__bool__) is changed. The examples Serhiy gives are similar. If `bool(a)` evaluates to False, then

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

2021-01-12 Thread Mark Shannon
New submission from Mark Shannon : The following examples produce incorrect line numbers, due to cleanup code not being marked as artificial def f(): try: if False: pass except: X def g(a): with a: if False: pass

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

2021-01-12 Thread Steve Stagg
Steve Stagg added the comment: I got my and/or logic inverted, but believe the point still stands -- ___ Python tracker ___ ___

[issue42904] get_type_hints does not provide localns for classes

2021-01-12 Thread Ken Jin
Ken Jin added the comment: > Fidget-Spinner, are you interested in taking this? Sure thing! Please give me some time to look at it - I don't really use the runtime type validation stuff from typing (I usually defer that to 3rd party libraries), so I need to familiarize myself first.

[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-01-12 Thread Berker Peksag
Berker Peksag added the comment: We can always reopen GH-24135 and merge it even if we revert this one for some reason :) -- ___ Python tracker ___

[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-01-12 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: True that :) I'll close GH-24135 for now and open a PR for this later today. -- ___ Python tracker ___

[issue42907] Division betwen float and 100 not giving corect result

2021-01-12 Thread Dimo Yordanov
Dimo Yordanov added the comment: And it appears that these are the only numbers (2.8 and 2.7) that behave like this -- ___ Python tracker ___

[issue42907] Division betwen float and 100 not giving corect result

2021-01-12 Thread Christian Heimes
Christian Heimes added the comment: This is the expected behavior for float. Python's floats are IEEE 754 double precision floats, not arbitrary preciscion floats. See https://docs.python.org/3/tutorial/floatingpoint.html -- nosy: +christian.heimes resolution: -> not a bug stage:

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

2021-01-12 Thread Steve Stagg
Steve Stagg added the comment: To be super pedantic, as per my understanding of: "6.11 ... The expression x and y first evaluates x; if x is false, its value is returned; otherwise, y is evaluated and the resulting value is returned." The only corner that was previously cut is that in this

[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-01-12 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: I can throw up the PoC branch as a draft PR after GH-24135 is merged. We can just close the PR if this is uninteresting or something we want to postpone. -- ___ Python tracker

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

2021-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Steve. Yes, this is what I meant. "if a and b" is so common that we sacrifice literal translation for the sake of performance. "if" with an empty block looks pretty uncommon to me. It is not worth to optimize this case specially (especially if

[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-01-12 Thread Berker Peksag
Berker Peksag added the comment: I don't see any reason to merge GH-24135 if we are going to remove cache.[ch] in this issue. I was -0 before but since Raymond gave his +1, you can count me as +1 too. -- ___ Python tracker

[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-01-12 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: > I don't see any reason to merge GH-24135 if we are going to remove cache.[ch] > in this issue. Yes, I've thought about that myself. A small argument pro merging GH-24135 would be that if we for some reason decide to revert this change, then

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

2021-01-12 Thread Julien Palard
Julien Palard added the comment: Question: Why do we keep setuptools? According to PEP453: > Once pip is able to run pip install --upgrade pip without needing setuptools > installed first, then the private copy of setuptools will be removed from > ensurepip in subsequent CPython releases.

[issue42905] Issue while installing numba inside fastparquet

2021-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Neither numba nor fastparquet are parts of the standard Python library. Please use corresponding bug trackers. -- nosy: +serhiy.storchaka resolution: -> third party stage: -> resolved status: open -> closed

[issue11021] email MIME-Version headers for each part in multipart message

2021-01-12 Thread robin
robin added the comment: Propose to close as duplicate of https://bugs.python.org/issue25235 -- nosy: +eriker ___ Python tracker ___

[issue42909] Email header with ; ; ; ; stuffing takes very long to parse

2021-01-12 Thread robin
robin added the comment: python -mtrace -t repro.py reveals a long string of these: --- modulename: errors, funcname: __init__ errors.py(85): super().__init__(*args, **kw) --- modulename: errors, funcname: __init__ errors.py(37): if line is not None: errors.py(38):

[issue16615] gcc 4.7 unused-but-set warnings

2021-01-12 Thread Irit Katriel
Irit Katriel added the comment: Is this about the pre-version 3.3 warnings? If so it can be closed. -- nosy: +iritkatriel status: open -> pending ___ Python tracker ___

[issue16615] gcc 4.7 unused-but-set warnings

2021-01-12 Thread STINNER Victor
STINNER Victor added the comment: We are now dealing with GCC 11 warnings, I close this issue. Moreover, the GCC warnings are not mentioned. -- nosy: +vstinner resolution: -> out of date stage: -> resolved status: pending -> closed ___ Python

[issue42909] Email header with ; ; ; ; stuffing takes very long to parse

2021-01-12 Thread robin
New submission from robin : Attached please find a script which takes on the order of 1 minute to parse even though the embedded message is reasonably trivial. The main flaw is that the Content-Type: header has a long string of redundant which is something some spammers apparently use

[issue42905] Issue while installing numba inside fastparquet

2021-01-12 Thread Steve Stagg
Steve Stagg added the comment: Hi Sachit I see you raised this issue with the numba library here: https://github.com/numba/numba/issues/6630 I would recommend sticking with the numba issue unless they can confirm there is an issue with core python -- nosy: +stestagg

[issue42880] ctypes: variadic function call still doesn't work on Apple Silicon

2021-01-12 Thread Ronald Oussoren
Change by Ronald Oussoren : -- assignee: -> docs@python components: +Documentation nosy: +docs@python ___ Python tracker ___ ___

[issue42880] ctypes: variadic function call still doesn't work on Apple Silicon

2021-01-12 Thread Ronald Oussoren
Ronald Oussoren added the comment: I agree that this should be mentioned in the documentation for ctypes. -- ___ Python tracker ___

[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not like using _functools._lru_cache_wrapper. It is a deep implementation detail, private function of private module. Use functools.lru_cache. If it is few nanoseconds slower, that cost is only added at connection creation time. It is insignificant

[issue25235] EmailMessage.add_attachment() creates parts with spurious MIME-Version header.

2021-01-12 Thread robin
robin added the comment: Duplicate of https://bugs.python.org/issue11021 but this one is more current and has a patch. -- nosy: +eriker ___ Python tracker ___

[issue42843] What min_sphinx for Python 3.10

2021-01-12 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10, vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-01-12 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25077] Compiler warnings: initialization from incompatible pointer type

2021-01-12 Thread Irit Katriel
Irit Katriel added the comment: Issues 22038 and 23085 seem to have fixed all these warnings between them. -- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker

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

2021-01-12 Thread Mark Shannon
Mark Shannon added the comment: The question still stands. Is converting `if x: pass` to `pass` legal? And, if it is not, is converting if a and b: body to if a: if b: body a legal transformation? (ignoring line numbers) If the first transformation is not allowed but

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

2021-01-12 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +23027 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24202 ___ Python tracker ___

[issue24650] Error in yield expression documentation

2021-01-12 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +easy versions: +Python 3.10 -Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker ___

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

2021-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: Can we translate 'if x: pass' into 'pass'? No, because calling its __bool__ method may have a side effect (as we saw at the start of this thread). Can we eliminate a lone 'x'? Only if it's a local variable and we're *sure* (because of control flow

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

2021-01-12 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +mark.dickinson, tim.peters ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42889] Incorrect behavior of Python parser after ast node of test program being modified

2021-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: Yeah, there's supposed to be a checker. -- nosy: +lys.nikolaou, serhiy.storchaka ___ Python tracker ___

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

2021-01-12 Thread Mark Shannon
Mark Shannon added the comment: They aren't quite the same. If `a` is falsey, and bool(a) has a side-effect, then that side-effect should occur twice in: if a and b: ... but only once in if a: if b: ... It gets more interesting (silly), if `a.__bool__()` alternated between

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

2021-01-12 Thread Mark Shannon
Change by Mark Shannon : -- priority: normal -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42843] What min_sphinx for Python 3.10

2021-01-12 Thread STINNER Victor
STINNER Victor added the comment: Ah, the issue is also being discussed in PR 24142 comments. -- ___ Python tracker ___ ___

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

2021-01-12 Thread Ethan Furman
Ethan Furman added the comment: If an optimization changes semantics it's not an optimization. In `if x: pass` how do we know `x` is falsely without calling `bool()` on it? --- On a slightly different note, in the code: if a and b: ... why is `bool(a)` called twice?

[issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries

2021-01-12 Thread seb
seb added the comment: I tried that before, also with your command, without success. I saw that the CFLAGS includes weren't forwarded to the compiler - I don't know if that is only an issue here on my system. So instead I modified the setup.py and added the directory manually. It now works.

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

2021-01-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: Gregory: Even in a low-level compiled language (say, C++), pretty sure the compiler can't automatically optimize out: if (x) { } unless it has sure knowledge of the implementation of operator bool; if operator bool's implementation isn't in the header

[issue42918] Nested multi-line expression will lead to "compile()" fails

2021-01-12 Thread Xinmeng Xia
New submission from Xinmeng Xia : For build-in function compile() in mode 'single', only single statement can be well compiled. If we compile multiple statements, the parser will raise a syntaxError. Seeing the following two programs, In program 1, 2 statement are compiled. So the parser

[issue42918] Nested multi-line expression will lead to "compile()" fails

2021-01-12 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +lys.nikolaou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42919] Blank in multiline “if expressions” will lead to EOF errors

2021-01-12 Thread Xinmeng Xia
New submission from Xinmeng Xia : In build-in function compile() of mode 'single', single statement can be well compiled. (see program 1 and program 2). However, if we leave 4 blank spaces before the end of triple-quotation mark of "if expression",(see program 3), The parser will raise

[issue42918] Nested multi-line expression will lead to "compile()" fails

2021-01-12 Thread Xinmeng Xia
Change by Xinmeng Xia : -- components: +Interpreter Core ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21895] signal.pause() and signal handlers don't react to SIGCHLD in non-main thread

2021-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: When I removed myself from the nosy list I did mean to stop working on this bug, just that I am unlikely to be of any help. :-) -- nosy: +gvanrossum ___ Python tracker

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

2021-01-12 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +23031 pull_request: https://github.com/python/cpython/pull/24205 ___ Python tracker ___

[issue42913] asyncio.ProactorEventLoop mishandles signal wakeup file descriptor

2021-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: Looks this was not tested or thought through with multiple loops and signals (admittedly, using signals is never fun, and even less so on Windows). Can you send a PR with a fix? -- nosy: +gvanrossum ___ Python

[issue42919] Blank in multiline “if expressions” will lead to EOF errors

2021-01-12 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +lys.nikolaou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42918] Nested multi-line expression will lead to "compile()" fails

2021-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: What does the bytecode for c in program 2 look like? Also, how do you find all these bugs? Are you developing a new fuzzier? -- nosy: +gvanrossum ___ Python tracker

[issue42918] Nested multi-line expression will lead to "compile()" fails

2021-01-12 Thread Xinmeng Xia
Xinmeng Xia added the comment: The bytecode of c is as following: 0 LOAD_CONST 0 (1) 2 STORE_NAME 0 (d) 4 LOAD_CONST 1 (None) 6 RETURN_VALUE === Yes,

[issue42918] Nested multi-line expression will lead to "compile()" fails

2021-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: It’s good work! Is it open source? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42920] How to add end_lineno in pyclbr?

2021-01-12 Thread Aviral Srivastava
New submission from Aviral Srivastava : I created a PR a year ago, https://github.com/python/cpython/pull/16466/files, and now the source code is completely changed. How do I create another PR or if there is another way through which I can get an end line for each object (class and function)

[issue42918] Nested multi-line expression will lead to "compile()" fails

2021-01-12 Thread Xinmeng Xia
Xinmeng Xia added the comment: For sure! As soon as we validate this technique, we will open source it on GitHub. -- ___ Python tracker ___

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

2021-01-12 Thread Ethan Furman
Ethan Furman added the comment: I just finished a rewrite of Flag for 3.10. Using your test below I was able to tweak the rewrite so the final numbers are: Took normal 0.148092 seconds. Took cached 0.017438 seconds. Your original post had a ratio of nearly 200 -- it is now 8.7ish.

[issue42901] [Enum] move member creation to __set_name__ in order to support __init_subclass__

2021-01-12 Thread Ethan Furman
Ethan Furman added the comment: New changeset c314e60388282d9829762fb6c30b12e2807caa19 by Ethan Furman in branch 'master': bpo-42901: [Enum] move member creation to `__set_name__` (GH-24196) https://github.com/python/cpython/commit/c314e60388282d9829762fb6c30b12e2807caa19 --

[issue42921] Inferred Optional type of wrapper function arguments

2021-01-12 Thread Joseph Perez
New submission from Joseph Perez : `typing.get_type_hints` gives a different result for a wrapper created with `functools.wraps` in case of inferred `Optional` arguments (when the default value of the argument is None) ```python from functools import wraps from typing import get_type_hints

[issue42914] pprint numbers with underscore

2021-01-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: > It would be nice if pprint learned to insert underscores in long numbers +1 but I would make this optional. > Here is an implementation of the safe repr for numbers if helpful I suggest using the existing string formatting tools as a foundation

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

2021-01-12 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15373] copy.copy() does not properly copy os.environment

2021-01-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: Would we remove the functionality of os.environ.copy()? It seems very odd for types to have a .copy() method that works, while not supporting copy.copy, especially when there is zero documentation, on the web or the docstring, to even hint at the

  1   2   >