[issue43257] get_type_hints evaluates class variables before type hints

2021-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: Oops, I realized it's not really a compiler bug. When the compiler sees class C: str: str = "abc" if effectively rearranges that to class C: str = "abc" __annotations__["str"] = str (where __annotations__ i

[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for the clarifications, Victor! So I now understand: the *identity* of the builtins dict used by a function's code is captured when the function object is created. And I understand why: it's so that in the fast path for the LOAD_GLOBAL

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: > It's not a huge deal, but I vote that we either drop or rework the > "http_error" examples. I think it gives people a very wrong first impression > that makes the rest of the behavior quite surprising. > > Can it be cha

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Guido van Rossum
Change by Guido van Rossum : -- pull_requests: +23368 pull_request: https://github.com/python/cpython/pull/24588 ___ Python tracker <https://bugs.python.org/issue42

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: I don't know who's really in charge of the docs. I suppose the PEP authors are, collectively, but that runs the risk that we're all expecting the person to our left in the circle to do it. Would people be okay if I added the tutorial from Ap

[issue43271] AMD64 Windows10 3.x crash with Windows fatal exception: stack overflow

2021-02-19 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +Mark.Shannon, gvanrossum ___ Python tracker <https://bugs.python.org/issue43271> ___ ___ Python-bugs-list mailin

[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks, that's clearer. I'm still worried about the change in semantics where globals["__builtins__"] is assigned a different dict after the function object has been created (similar to https://bugs.python.org/file49816/func_builtins2

[issue37146] opcode cache for LOAD_GLOBAL emits false alarm in memory leak hunting

2021-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: Please revert this and use a separate build flag (e.g. DISABLE_INLINE_CACHES) for the refleaks run. (Or perhaps provide an -X flag to disable it without the need to recompile.) I am developing new inline cache ideas and of course I need to run in debug

[issue43255] Ceil division with /// operator

2021-02-19 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker <https://bugs.python.org/issue43255> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43257] get_type_hints evaluates class variables before type hints

2021-02-19 Thread Guido van Rossum
Guido van Rossum added the comment: Sure looks like a compiler bug! Can you investigate whether this occurs in earlier Python versions? Maybe bisect if it doesn’t? -- ___ Python tracker <https://bugs.python.org/issue43

[issue42840] `type` takes **kwargs for __init_subclass__

2021-02-18 Thread Guido van Rossum
Guido van Rossum added the comment: I'll try to review it in the coming weeks. -- ___ Python tracker <https://bugs.python.org/issue42840> ___ ___ Pytho

[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-18 Thread Guido van Rossum
Guido van Rossum added the comment: Victor > the new globals has no "__builtins__" key. This change is backward > incompatible on purpose. If someone really wants to run a function in a > different builtins namespace, globals['__builtins__'] must be set explici

[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-17 Thread Guido van Rossum
Guido van Rossum added the comment: > FWIW the globals opcode cache handles all of this now. There's no point in > specifically optimizing the builtins lookup since we optimize all global > lookups for a code object that's hot enough. So you think that even a dedicated

[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-17 Thread Guido van Rossum
Guido van Rossum added the comment: Well maybe I'll be picking up those ideas again... Thanks for documenting so much of what you did then! -- ___ Python tracker <https://bugs.python.org/is

[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-17 Thread Guido van Rossum
Guido van Rossum added the comment: +1 on exposing f,__builtins__. Of course, the thing I'd really want is a way to state that all references to builtins are meant to have the exact semantics of those builtins, so the compiler can translate e.g. len(x) into a new opcode that just

[issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor

2021-02-17 Thread Guido van Rossum
Guido van Rossum added the comment: I doubt that solution is correct, given that we already established that the problem is *not* specific to Generic. -- ___ Python tracker <https://bugs.python.org/issue40

[issue43243] Strict ABC classes

2021-02-17 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker <https://bugs.python.org/issue43243> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43243] Strict ABC classes

2021-02-17 Thread Guido van Rossum
Guido van Rossum added the comment: This discussion is not appropriate for the bug tracker. Try finding a user forum to discuss the pros and cons and history of the current functionality. It is clear that you have plenty of ways to discover the problem already. -- resolution

[issue41824] Docs for typing.ForwardRef don't state that it was added in 3.7

2021-02-09 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41824] Docs for typing.ForwardRef don't state that it was added in 3.7

2021-02-09 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 822f7c266f886677047338e8b167ba39a6abd91e by Ken Jin in branch '3.8': [3.8] bpo-41824: Fix indentation issue in ForwardRef docs (#24495) https://github.com/python/cpython/commit/822f7c266f886677047338e8b167ba

[issue41824] Docs for typing.ForwardRef don't state that it was added in 3.7

2021-02-09 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset c8a48c6d0417cc8f256a40142962825febdc2e20 by Ken Jin in branch '3.8': [3.8] bpo-41824: Add versionadded for typing.ForwardRef docs (#24224) (#24494) https://github.com/python/cpython/commit/c8a48c6d0417cc8f256a4014296282

[issue41824] Docs for typing.ForwardRef don't state that it was added in 3.7

2021-02-09 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 917eca700aa341f8544ace43b75d41b477e98b72 by Ken Jin in branch '3.9': bpo-41824: Add versionadded for typing.ForwardRef docs (#24224) (#24493) https://github.com/python/cpython/commit/917eca700aa341f8544ace43b75d41

[issue42377] allow typing.cast with TYPE_CHECKING

2021-02-08 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41824] Docs for typing.ForwardRef don't state that it was added in 3.7

2021-02-08 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset da21f7b6e1fd5bd3e78931a06c5eb694f6335233 by Ken Jin in branch 'master': bpo-41824: Add versionadded for typing.ForwardRef docs (#24224) https://github.com/python/cpython/commit/da21f7b6e1fd5bd3e78931a06c5eb694f6335233 -

[issue42128] Structural Pattern Matching (PEP 634)

2021-02-08 Thread Guido van Rossum
Guido van Rossum added the comment: The PEP has been accepted. I propose that we use separate PRs for docs (and incremental improvements to the code) but tie them all together using the same issue number (this will require adding "skip news" to

[issue43166] Unused letters in Windows-specific pragma optimize

2021-02-08 Thread Guido van Rossum
New submission from Guido van Rossum : A coworker happened to look at our use of #pragma optimize() for Windows (VS 2017) and noticed: unless there’s something I’m missing, the ‘a’ and ‘w’ portions of the string being passed to the optimize pragma are not doing anything; I’m pretty sure

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

2021-02-02 Thread Guido van Rossum
Guido van Rossum added the comment: I don't care about the flipflop at all. I only care about the third possible outcome, an exception. I thought the compromise semantics you proposed earlier sounded nice. As Serhiy already explained, 'b or True' vs. 'Tru

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

2021-02-01 Thread Guido van Rossum
Guido van Rossum added the comment: I still favor (3) -- I don't want to renege on the promise we made when we allowed overloading comparisons to return something other than a bool. -- ___ Python tracker <https://bugs.python.org/is

[issue26455] Inconsistent behavior with KeyboardInterrupt and asyncio futures

2021-02-01 Thread Guido van Rossum
Guido van Rossum added the comment: If you just need help, I recommend https://discuss.python.org/c/users/7 If you still have an issue with ^C, open a new issue. -- ___ Python tracker <https://bugs.python.org/issue26

[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2021-01-29 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! The loop overhead is presumably dramatic in that example. I think I measured a somewhat bigger speedup using timeit, which IIRC subtracts the cost of an empty loop. But you're right that 5% on a micro-benchmark is not very exciting. I wond

[issue42927] Inline cache for slots

2021-01-29 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> fixed stage: patch review -> commit review status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42927] Inline cache for slots

2021-01-29 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 5c5a938573ce665f00e362c7766912d9b3f3b44e by Guido van Rossum in branch 'master': bpo-42927: Inline cache for attributes defined with '__slots__' (#24216) https://github.com/python/cpython/commit/5c5a938573ce665f00e3

[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2021-01-29 Thread Guido van Rossum
Guido van Rossum added the comment: I had a simpler idea for an inline cache for LOAD_METHOD than GH-23503. The essential part goes like this (sorry for the hybrid C/Python): if : if type == lm->type and type->tp_version_tag == lm->tp_version_tag: meth = lm->meth

[issue42974] tokenize reports incorrect end col offset and line string when input ends without explicit newline

2021-01-29 Thread Guido van Rossum
Guido van Rossum added the comment: Do you still need my opinion? I can't say that I have one ATM. -- ___ Python tracker <https://bugs.python.org/is

[issue42384] Inconsistent sys.path between python and pdb

2021-01-26 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42383] Pdb does not correclty restart the target if it changes the current directory

2021-01-26 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42383] Pdb does not correclty restart the target if it changes the current directory

2021-01-26 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset d863deeff27f00ac33e9f169d23ca56d69af3f86 by Andrey Bienkowski in branch '3.8': [3.8] bpo-42383: pdb: do not fail to restart the target if the current directory changed (GH-23412) (#24323) https://github.com/python/cpyt

[issue42383] Pdb does not correclty restart the target if it changes the current directory

2021-01-26 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset f8cfe54e5a7082edcec74a34b3d7e6afab051afd by Andrey Bienkowski in branch '3.9': [3.9] bpo-42383: pdb: do not fail to restart the target if the current directory changed (GH-23412) (#24322) https://github.com/python/cpyt

[issue42384] Inconsistent sys.path between python and pdb

2021-01-25 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset c10180ea1458aa0ffd7793cb75629ebffe8a257e by Andrey Bienkowski in branch '3.8': [3.8] bpo-42384: pdb: correctly populate sys.path[0] (GH-23338) (#24320) https://github.com/python/cpython/commit/c10180ea1458aa0ffd7793cb75629e

[issue42384] Inconsistent sys.path between python and pdb

2021-01-25 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset f2df7958fb82cd927e17152b3a1bd2823a76dd3e by Andrey Bienkowski in branch '3.9': [3.9] bpo-42384: pdb: correctly populate sys.path[0] (GH-23338) (#24321) https://github.com/python/cpython/commit/f2df7958fb82cd927e17152b3a1bd2

[issue42383] Pdb does not correclty restart the target if it changes the current directory

2021-01-25 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 501d4a51e32c7bbba255598adc307660b5af891a by Andrey Bienkowski in branch 'master': bpo-42383: pdb: do not fail to restart the target if the current directory changed (#23412) https://github.com/python/cpyt

[issue43007] set_wakeup_fd() only works in main thread

2021-01-23 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue43007> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43006] Changed behaviour of inspect.signature() in Python 3.10

2021-01-23 Thread Guido van Rossum
Guido van Rossum added the comment: Note that this may be solved in a different way *if* PEP 649 is accepted. This was discussed extensively on python-dev last week. It would roll back the stringification of PEP 563 (unless `from __future__ import annotations` is used, which would be

[issue43005] Package Relative Imports - double dot doc example not working

2021-01-22 Thread Guido van Rossum
Guido van Rossum added the comment: This is not a bug in Python. Please ask a user forum for help understanding (for example, https://discuss.python.org/c/users/7). -- nosy: +gvanrossum resolution: -> not a bug stage: -> resolved status: open -&g

[issue43004] No type variables left in collections.abc.Callable

2021-01-22 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +kj ___ Python tracker <https://bugs.python.org/issue43004> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-01-22 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue42990> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42384] Inconsistent sys.path between python and pdb

2021-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: Hey Andrey, this has been merged into 3.10, but the backports didn't work because the structure of the tests has changed (os_helper doesn't exist). Do you want to fix these? -- nosy: +gvanrossum

[issue42990] Improve the C code for calling Python code

2021-01-21 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +brett.cannon, petr.viktorin, rhettinger, serhiy.storchaka, vstinner, yselivanov ___ Python tracker <https://bugs.python.org/issue42

[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Guido van Rossum
Guido van Rossum added the comment: > I use the same heuristic as Pypy: the callable is a bound method, the first > name in the definition is not named "self" and it was called with n+1 > positional arguments. Okay, that makes sense, you could have said so in the bu

[issue42984] Python 3.7 and qt Libraries

2021-01-20 Thread Guido van Rossum
Guido van Rossum added the comment: I recommend asking on a user forum, perhaps https://discuss.python.org/c/users/ -- nosy: +gvanrossum resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracke

[issue42983] sys.argv incorrectly parses command lines with args in environment variables.

2021-01-20 Thread Guido van Rossum
Guido van Rossum added the comment: That looks like you need to learn more about the shell. It is not a Python bug. -- nosy: +gvanrossum resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracke

[issue42978] Improve error message when "self" is missing from the method definition

2021-01-20 Thread Guido van Rossum
Guido van Rossum added the comment: I don't think this makes sense. How do you know there's a missing 'self'? Surely it's just as likely that there is indeed an extra argument. Especially if A.foo is defined by a library (stdib or 3rd party). ---

[issue42971] Some errnos for BSD/OSX are missing from errno module

2021-01-19 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +ned.deily, ronaldoussoren ___ Python tracker <https://bugs.python.org/issue42971> ___ ___ Python-bugs-list mailin

[issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP'

2021-01-18 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker <https://bugs.python.org/issue42959> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36143] Auto-generate Lib/keyword.py

2021-01-18 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker <https://bugs.python.org/issue36143> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP'

2021-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: As the docs explain, SIGHUP is not available on Windows. This is as designed. -- nosy: +gvanrossum resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bug

[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: I'm not keen on prohibiting nonlocal variable reference in annotations, since I can imagine uses for this (e.g. in tests). I'm not too worried about keeping the cell alive "forever", since with Larry's PEP 649 their lifetime

[issue42913] asyncio.ProactorEventLoop mishandles signal wakeup file descriptor

2021-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: No pressure. If there's an API change needed you will have until 3.10 beta 1. Without API changes this can be fixed any time. -- ___ Python tracker <https://bugs.python.org/is

[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: It'll probably be quicker if you leave me out of the loop (feel free to quote me though). I am currently quite overwhelmed with PEP-sized discussions. I expect that the SC can rule on this quickly (just use their tracker to send them th

[issue42953] After the subclass of enum.Enum is imported in some diffenent ways, the same enumeration value is judged as False

2021-01-18 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +ethan.furman ___ Python tracker <https://bugs.python.org/issue42953> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42935] Pickle can't import builtins at exit

2021-01-15 Thread Guido van Rossum
Guido van Rossum added the comment: I don’t know there is much we can do about this. I recommend using ‘with’ to close the shelf earlier. -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue42

[issue42927] Inline cache for slots

2021-01-15 Thread Guido van Rossum
Guido van Rossum added the comment: I created a benchmark for this, see https://github.com/python/pyperformance/pull/86. Next I'll add a blurb and then it's off to reviewers. -- ___ Python tracker <https://bugs.python.o

[issue42934] use TracebackException's new compact param in unittest.TestResult

2021-01-15 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset ba876c44a8d06668e622fb580fdcde45c7a36d48 by Irit Katriel in branch 'master': bpo-42934: use TracebackException(compact=True) in unittest.TestResult (GH-24221) https://github.com/python/cpython/commit/ba876c44a8d06668e622fb580fdcde

[issue42934] use TracebackException's new compact param in unittest.TestResult

2021-01-15 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42932] How to handle import tripartite pacakge issue in unittest scripts for python expect mock.Mock

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: Please try a user forum. E.g. stackoverflow. -- nosy: +gvanrossum resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

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

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

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

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 4c94d74152a511d977fe26a4f3a32b7352ba9024 by Irit Katriel in branch 'master': bpo-42877: add the 'compact' param to TracebackException's __init__ (#24179) https://github.com/python/cpython/commit/4c94d74152a511d

[issue42927] Inline cache for slots

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for all the positive feedback! What is the next step? -- ___ Python tracker <https://bugs.python.org/issue42

[issue42920] How to add end_lineno in pyclbr?

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: Hopefully Batuhan (who changed this code ~2 months ago) or Cheryl (who reviewed your previous patch) can help you. You can just close your existing PR and create a new one, still linking to your original issue 38307. -- nosy: +BTaskaya

[issue42928] adafruit_ads1x15.ads1115 not comaptible with globals()[pkg_trunc] = importlib.import_module(pkg_trunc)

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: They did not imply it was a bug, just that they don't know enough about Python to be able help you. As I said, this tracker is not a help forum (you're taking valuable time away from core developers). Try this forum: https://discuss.python.org

[issue42928] adafruit_ads1x15.ads1115 not comaptible with globals()[pkg_trunc] = importlib.import_module(pkg_trunc)

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, this is not a help forum. Please try a user forum. Probably you have to find one with people using the Adafruit modules (and CircuitPython?). -- nosy: +gvanrossum resolution: -> third party stage: -> resolved status: open -&g

[issue42927] Inline cache for slots

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

[issue42927] Inline cache for slots

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

[issue42925] Error trace of else inside class

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

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

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

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

2021-01-13 Thread Guido van Rossum
Guido van Rossum added the comment: Is anyone still in favor of eliminating the __bool__ call from ‘if p: pass’? -- ___ Python tracker <https://bugs.python.org/issue42

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

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

[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 <https://bugs.python.org/issue42918> ___ ___ Python-bugs-list mailin

[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 <https://bugs.python.org/issue42

[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 <https://bugs.python.org/issue42918> ___ ___ Python-bugs-list mailing list Unsubscribe:

[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 <https://bugs.python.org/issue42919> ___ ___ Python-bugs-list mailing list Unsubscribe:

[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

[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 <https://bugs.python.org/issue21

[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 <https://bugs.python.org/issue42915> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42848] asyncio produces an unexpected traceback with recursive __getattribute__

2021-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: Will be fixed in 3.10. I prefer not to backport the solution (Irit, do you agree?) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bug

[issue42848] asyncio produces an unexpected traceback with recursive __getattribute__

2021-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 6dfd1734f5b230bb8fbd2a9df806c1333b6652a8 by Irit Katriel in branch 'master': bpo-42848: remove recursion from TracebackException (GH-24158) https://github.com/python/cpython/commit/6dfd1734f5b230bb8fbd2a9df806c1

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

2021-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: Whoops, I meant export PYTHONPATH=. -- ___ Python tracker <https://bugs.python.org/issue42906> ___ ___ Python-bugs-list m

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

2021-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, this is not a bug. The builtin time module takes precedence in this case because the current directory is not put at the front of the module search path (sys.path). As a workaround you could exportPYTHONPATH=. -- nosy: +gvanrossum

[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: Hm, I hadn't realized the issue of bool(a) being evaluated once or twice. The most important side effect that bool(a) can have is raising (as e.g. numpy arrays do), not producing random results. Another important side effect might be loading some

[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 <https://bugs.python.org/is

[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 <https://bugs.python.org/issue42911> ___ ___ Python-bugs-list mailin

[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&

[issue42904] get_type_hints does not provide localns for classes

2021-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: It's apparently a bug in all versions that support `from __future__ import annotations` (and only when that is used). Though perhaps we should only fix in in 3.10. -- ___ Python tracker &

[issue42904] get_type_hints does not provide localns for classes

2021-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: Fidget-Spinner, are you interested in taking this? -- ___ Python tracker <https://bugs.python.org/issue42904> ___ ___ Pytho

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

2021-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, if your argument is just that you can make invalid identifiers this way, I still don't see why that's a big deal. You can do `x.__dict__["1"] = 1` and now you've given x an attribute that's not a valid identifier. You co

[issue42900] Ternary operator precedence relative to bitwise or

2021-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: You may be surprised, but it's not a bug -- '|' binds tighter than 'if'/'else'. If you need more help, please contact a user forum. -- nosy: +gvanrossum resolution: -> not a bug stag

[issue42775] __init_subclass__ should be called in __init__

2021-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks, that's great! And thanks, Nick! -- ___ Python tracker <https://bugs.python.org/issue42775> ___ ___ Python-bugs-l

[issue42870] Document changed argparse output wrt optional arguments in What's new in Python 3.10

2021-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for your fix! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42870] Document changed argparse output wrt optional arguments in What's new in Python 3.10

2021-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset fb35fa49d192368e94ffec09c092260ed0fea2e1 by Tomáš Hrnčiar in branch 'master': bpo-42870: Document change in argparse help output. (GH-24190) https://github.com/python/cpython/commit/fb35fa49d192368e94ffec09c09226

[issue42812] @overload-ing method of parent class without actual implementation

2021-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: I hesitate to add anything because you are exposing so much confusion. May I suggest that you ask about this on a user group first before proposing a new feature? One place that makes sense given that this is a type system feature would be this Gitter

<    4   5   6   7   8   9   10   11   12   13   >