[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: I don't think this is a bug, unless you can show an example where the bytecode compiler or the interpreter actually crashes. Basically you can change AST nodes in lots of ways that don't correspond to valid programs, and as long as you can't make CPython

[issue42894] Debugging native Python modules on Windows with Visual Studio Toolchain

2021-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: Steve, is there a better way? -- components: +Windows -C API nosy: +gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker <https://bugs.python.org/issue42

[issue42895] Return multi-line list concatenation without parentheses returns only first operand

2021-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: This is not a bug -- it is how it's supposed to work (for better or for worse). Please see a use forum to help you understand what's going on here. -- nosy: +gvanrossum resolution: -> not a bug stage: -> resolved status: open -&g

[issue42886] math.log and math.log10 domain error on very large Fractions

2021-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: The problem with that formulation of the feature request is that it would require the math.log function to recognize rationals, or at least the Fraction type. Since the numeric tower and the fractions module are implemented in pure Python that would

[issue42878] urllib.request.HTTPPasswordMgr.is_suburi does not care about order

2021-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: Cheryl, do you have time to review this? -- nosy: +cheryl.sabella, gvanrossum ___ Python tracker <https://bugs.python.org/issue42

[issue42881] Should typing.get_type_hints change None annotations?

2021-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: I agree this is a bit unfortunate, but I also think it's a bit late to change now. However *if* we're going to change it we should do it now (in 3.10) or never. Given that we never *write* type(None) in annotations, it's unfortunate to get that back

[issue42886] math.log and math.log10 domain error on very large Fractions

2021-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: I guess another approach might be to change the math module so that all its functions support franctions (and decimal, and other esoteric number types). But that would require having __log__ and many others as methods on the numeric types. Personally I

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

2021-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: Quickest way to get that done is to send in a PR that updates whatsnew. -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue42

[issue42850] Process hangs when calling urllib.request in a multiprocessing.Process with import of sounddevice package

2021-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: No, let's leave 3.7 alone -- it's in security-fixes-only mode. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

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

2021-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Oh, you’re right about walrus. And I don’t actually understand async generator expressions. This suggests that we definitely need a PEP. :-) -- ___ Python tracker <https://bugs.python.org/issue42

[issue42850] Process hangs when calling urllib.request in a multiprocessing.Process with import of sounddevice package

2021-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: I would assume it’s some interaction between threads and fork. Have you asked the authors of sound device about this? -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue42

[issue42857] Fails to construct paths lead to "python is likely shutting down"

2021-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: You are doing something very evil during finalization here. There’s nothing that can be done reasonably. -- nosy: +gvanrossum resolution: -> wont fix stage: -> resolved status: open -> closed ___ Pytho

[issue42858] Incorrect return value for os.system() in recognizing import error

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

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

2021-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: I wouldn’t have thought you’d need a PEP for this but if you want to write one that sounds like the right thing. Re: async and walrus: I think those are different, their presence doesn’t affect the meaning of the function like yield. We can’t hope

[issue42859] smtplib: recipe for certifying message delivery

2021-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: This looks more like a question than an issue. Have you tried stackoverflow or a user forum? -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue42

[issue42848] asyncio produces an unexpected traceback with recursive __getattribute__

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: I meant Irit. Silly autocorrect. -- ___ Python tracker <https://bugs.python.org/issue42848> ___ ___ Python-bugs-list mailin

[issue42848] asyncio produces an unexpected traceback with recursive __getattribute__

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: No problem. Riot, are you interested in this? -- nosy: +Guido.van.Rossum, iritkatriel ___ Python tracker <https://bugs.python.org/issue42

[issue42848] asyncio produces an unexpected traceback with recursive __getattribute__

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: The recursion error is actually inside the traceback module. The reason is that the code there calls itself recursively for each level of context. Since bar() builds up an endless chain of contexts as it calls itself recursively, that chain is very long

[issue42848] asyncio produces an unexpected traceback with recursive __getattribute__

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: Is there anything specific about __getattribute__ here? Wouldn't you have the same issue for *any* function that raises RecursionError called inside an async def? -- nosy: +gvanrossum ___ Python tracker <ht

[issue42847] Normalise file encodings in Lib/sqlite3/test/

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: SGTM, the use of ISO-8859 is surely a legacy issue. -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue42

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

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: Excellent! -- ___ Python tracker <https://bugs.python.org/issue42840> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42839] SourceFileLoader does not (fully) accept path-like objects

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: If Brett's theory is right, compile() has a bug though -- it shouldn't plug a non-string into the code object. Or possibly the code object constructor should reject such objects (or extract the string

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

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: Undoubtedly -- but impact should be measured on what typical users would see, not on narrow benchmarks. -- ___ Python tracker <https://bugs.python.org/issue42

[issue42839] SourceFileLoader does not (fully) accept path-like objects

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: Maybe Brett can help? -- nosy: +brett.cannon, gvanrossum ___ Python tracker <https://bugs.python.org/issue42839> ___ ___

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

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: That sounds intentional to me (else the class statement would have a capability that cannot be dynamically emulated by calling type()). We should probably update the docs (if you could submit a small PR that would be appreciated) and also typeshed (ditto

[issue42841] Add bitwise or operator to collections.abc Mapping and MutableMapping

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: This was discussed during the PEP review and rejected. The main reason is that this operator would need to create a new instance, and there is no standard API that's part of the Mapping protocol that can be used (the constructor of a Mapping instance

[issue42845] Third Party Module Installation using pip fails in Python 3.10.0a3

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: This is expected -- those modules contain C extensions for which no 3.10 wheels are available from PyPI yet, so pip tries to build them locally. If you want to help testing, please install the recommended free version of the MS C++ compiler. From CPython

[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-06 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +gvanrossum, lys.nikolaou, pablogsal ___ Python tracker <https://bugs.python.org/issue42837> ___ ___ Python-bugs-list mailin

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

2021-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: Yield in an annotation should be a syntax error. -- ___ Python tracker <https://bugs.python.org/issue42725> ___ ___ Pytho

[issue42835] Can't Built libxml2 When Using Python 3.9.x

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

[issue42835] Can't Built libxml2 When Using Python 3.9.x

2021-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: Looks to me like this line is at fault: 607 | } else if PyLong_Check(obj) { That's not valid C. In the GitHub mirror this line has been corrected. -- resolution: -> third party stage: -> resolved status: open -&g

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

2021-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: Do we have good intuition or data about which operations need speeding up most? Everybody always assumes it's BINARY_ADD, but much Python code isn't actually numeric, and binary operations aren't all that common. (For example, IIRC at my previous employer

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

2021-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: I've skimmed several papers by Stefan Brunthaler about something called Quickening that I first found via the Pyston blog, which linked to an ancient bpo issue with a patch created by Stefan (https://bugs.python.org/issue14757). The gist seems

[issue42835] Can't Built libxml2 When Using Python 3.9.x

2021-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: Maybe libxml is using a deprecated API or an invalid combination of command line flags. I don't feel like debugging this until there's a clearer indication of who's at fault. -- ___ Python tracker <ht

[issue42835] Can't Built libxml2 When Using Python 3.9.x

2021-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: Have you approached the libxml2 developers with this problem? -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue42

[issue42828] Python readline module

2021-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: This should be discussed on a user forum, not in our bug tracker. -- nosy: +gvanrossum resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42829] get_type_hints throws for nested class with __future__ annotations

2021-01-05 Thread Guido van Rossum
Guido van Rossum added the comment: If you want this to work you have to pass the namespace where B is defined as locals to get_type_hint(). The recommended approach is to make B a global class; where that is not possible (as in your second example) you should chose a different name. We're

[issue42093] Add opcode cache for LOAD_ATTR

2021-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, I was thinking to recognize the specific type of descriptor used by slots and cache only that. Though we would still have to consider updates to C.__dict__ (that's handled by looking at the dict version right

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

2021-01-04 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +Guido.van.Rossum ___ Python tracker <https://bugs.python.org/issue42115> ___ ___ Python-bugs-list mailing list Unsub

[issue4714] print opcode stats at the end of pybench runs

2021-01-04 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> out of date stage: patch review -> resolved status: languishing -> closed ___ Python tracker <https://bugs.python.o

[issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1

2021-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: Please ping this issue if the backports don't auto-merge after the tests pass, or if the tests fail. -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue40

[issue42093] Add opcode cache for LOAD_ATTR

2021-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! Do you have any plans for further inline caches? I was wondering if we could reverse the situation for slots again by adding slots support to the LOAD_ATTR opcode inline cache... -- nosy: +gvanrossum

[issue42824] get_type_hints throws for local class reference

2021-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: This is a known limitation. To get this to work you have to pass globals() and locals(): typing.get_type_hints(Test, globals(), locals()) -- nosy: +gvanrossum resolution: -> wont fix stage: -> resolved status: open -&g

[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2021-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: Sounds good, go for it. I assume @brandtbucher won't mind. -- ___ Python tracker <https://bugs.python.org/issue40

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

2021-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: Excellent! -- ___ Python tracker <https://bugs.python.org/issue28937> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2021-01-03 Thread Guido van Rossum
Guido van Rossum added the comment: This issue probably needs a new champion. There is broad agreement but some bike shedding, so a PEP isn’t needed.-- --Guido (mobile) -- ___ Python tracker <https://bugs.python.org/issue28

[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2021-01-02 Thread Guido van Rossum
Guido van Rossum added the comment: That's fair. How do other builtins validate their pickling implementation? Since the pickling goes through __reduce__/__reduce_ex__ we could instead test that those methods return the expected results, that pickling roundtrips, and that unpickling those

[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2021-01-01 Thread Guido van Rossum
Guido van Rossum added the comment: Looks like we can close this now, right? You can open a separate issue in the python/typing repo to update typing_extensions. -- ___ Python tracker <https://bugs.python.org/issue41

[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2021-01-01 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 11276cd9c49faea66ce7760f26a238d1edbf6421 by Ken Jin in branch 'master': bpo-41559: Documentation for PEP 612 (GH-24000) https://github.com/python/cpython/commit/11276cd9c49faea66ce7760f26a238d1edbf6421

[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-01 Thread Guido van Rossum
Guido van Rossum added the comment: Did you check this with master? -- ___ Python tracker <https://bugs.python.org/issue42806> ___ ___ Python-bugs-list mailin

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Guido van Rossum
Guido van Rossum added the comment: > It makes sense to me to be able to do `(*a), b` if I can do `*a, b`, but I > don't really have a strong opinion on it. I disagree. *a is not an expression, so the normal rules for parenthesizing those don't apply. I've always thought of *a as a f

[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2020-12-30 Thread Guido van Rossum
Guido van Rossum added the comment: Honestly this seems like a bug in 3.8 to me (if it indeed behaves like this): >>> (*x), y (1, 2, 3) Every time I mistakenly tried (*x) I really meant (*x,), so it's surprising that (*x), y would be interpreted as (*x, y) rather than fla

[issue42775] __init_subclass__ should be called in __init__

2020-12-29 Thread Guido van Rossum
Guido van Rossum added the comment: I see this as a backwards incompatible change and it's not worth doing for what seems to me a very minor benefit. -- ___ Python tracker <https://bugs.python.org/issue42

[issue42775] __init_subclass__ should be called in __init__

2020-12-28 Thread Guido van Rossum
Guido van Rossum added the comment: Whoa, you start a discussion on python-dev and another on bpo? That sounds a bit hasty. -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue42

[issue42740] typing.py get_args and get_origin should support PEP 604 and 612

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

[issue42740] typing.py get_args and get_origin should support PEP 604 and 612

2020-12-28 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset efb1f0918fad2ba3346a986b0e958dc5753a7bbe by Ken Jin in branch 'master': bpo-42740: Support PEP 604, 612 for typing.py get_args and get_origin (GH-23942) https://github.com/python/cpython/commit/efb1f0918fad2ba3346a986b0e958dc5753a7bbe

[issue42093] Add opcode cache for LOAD_ATTR

2020-12-27 Thread Guido van Rossum
Guido van Rossum added the comment: Wow, this is amazing. I just found that this is now faster than slots. Should we mention that in What's New? (Of course there's an optimization possible for slots as well, but it would require complicating the cache struct. Maybe in 3.11

[issue42737] PEP 563: drop annotations for complex assign targets

2020-12-26 Thread Guido van Rossum
Guido van Rossum added the comment: Yeah, we're talking about a future here where `from __future__ import annotations` is always on. And that future is now. (3.10) -- ___ Python tracker <https://bugs.python.org/issue42

[issue42737] PEP 563: drop annotations for complex assign targets

2020-12-25 Thread Guido van Rossum
Guido van Rossum added the comment: So the distinction between simple and complex is to define what goes into `__annotations__`. As long as we don't disturb that I think it's fine not to evaluate anything. (There's also the effect on what's considered a local variable, inside functions

[issue40494] collections.abc.Callable and type variables

2020-12-25 Thread Guido van Rossum
Guido van Rossum added the comment: Indeed. Thanks! -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

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

2020-12-24 Thread Guido van Rossum
Guido van Rossum added the comment: Okay, let's do it. It should probably a post-parse check (before we invoke the bytecode compiler but after we have the AST in hand). -- ___ Python tracker <https://bugs.python.org/issue42

[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2020-12-23 Thread Guido van Rossum
Guido van Rossum added the comment: Huge thanks! I think the next step is to port the essence to typing_extensions, which has to work for anything from 3.5 up (or maybe 3.6), *including* 3.10 and above. https://github.com/python/typing/tree/master/typing_extensions Honestly maybe we could

[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2020-12-23 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 73607be68668ab7f4bee53507c8dc7b5a46c9cb4 by kj in branch 'master': bpo-41559: Implement PEP 612 - Add ParamSpec and Concatenate to typing (#23702) https://github.com/python/cpython/commit/73607be68668ab7f4bee53507c8dc7b5a46c9cb4

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

2020-12-23 Thread Guido van Rossum
Guido van Rossum added the comment: If we simply ignored yield in the annotation, wouldn't we have the problem that def f(a: (yield)): pass silently changes from being a generator (in 3.9) to not being a generator (in 3.10)? That would be bad. I'd rather make this an error still

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

2020-12-23 Thread Guido van Rossum
Guido van Rossum added the comment: The difference is that that just causes a slight inefficiency, while processing 'yield' makes the function a generator. So I don't feel as strongly about that. -- ___ Python tracker <https://bugs.python.

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

2020-12-23 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +lys.nikolaou ___ Python tracker <https://bugs.python.org/issue42725> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2020-12-23 Thread Guido van Rossum
Guido van Rossum added the comment: Ouch. I think we should generate a SyntaxError if yield [from] is used in an annotation. -- ___ Python tracker <https://bugs.python.org/issue42

[issue42675] Document changes made in bpo-42195

2020-12-19 Thread Guido van Rossum
Guido van Rossum added the comment: Can this be closed now? -- ___ Python tracker <https://bugs.python.org/issue42675> ___ ___ Python-bugs-list mailin

[issue42675] Document changes made in bpo-42195

2020-12-19 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 597ebc8cf604de49eabbc7b83be2debd005d7819 by kj in branch '3.9': [3.9] bpo-42675: Document collections.abc.Callable changes (GH-23839) (#23852) https://github.com/python/cpython/commit/597ebc8cf604de49eabbc7b83be2debd005d7819

[issue42683] asyncio should handle keyboard interrupt while the event loop is running

2020-12-19 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue42683> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42675] Document changes made in bpo-42195

2020-12-18 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset d75f6f78e6ca230d0dacc116dca9d8bf91509b68 by kj in branch 'master': bpo-42675: Document collections.abc.Callable changes (GH-23839) https://github.com/python/cpython/commit/d75f6f78e6ca230d0dacc116dca9d8bf91509b68

[issue41960] Add globalns and localns to the inspect.signature and inspect.Signature.from_callable

2020-12-16 Thread Guido van Rossum
Guido van Rossum added the comment: It's been a while, I've lost context for this idea. What problem are you trying to solve here? Are there issues where people have reported problems that this would allow them to solve? -- ___ Python tracker

[issue42577] Unhelpful syntax error when expression spans multiple lines

2020-12-15 Thread Guido van Rossum
Guido van Rossum added the comment: I think something should probably be done about this, but opening another tracker issue is not the way to make progress here. So I am closing the issue. It will happen in due time. No need to have more open issues. -- stage: -> resolved sta

[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-12-14 Thread Guido van Rossum
Guido van Rossum added the comment: Looks like we can close this. Thanks for the report Zac (hopefully you can live with the resolution), and thanks a bundle Ken Jin for all your work on this! I hope it was fun and educational for you. I know it was for me. -- resolution: -> fi

[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-12-14 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 33b3fedd43e10e5a227ec8b7d251496e7cad4717 by kj in branch '3.9': [3.9] bpo-42195: Ensure consistency of Callable's __args__ in collections.abc and typing (GH-23765) https://github.com/python/cpython/commit

[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2020-12-13 Thread Guido van Rossum
Guido van Rossum added the comment: This is now unblocked now that GH-23060 has landed. -- ___ Python tracker <https://bugs.python.org/issue41559> ___ ___ Pytho

[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-12-13 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 463c7d3d149283814d879a9bb8411af64e656c8e by kj in branch 'master': bpo-42195: Ensure consistency of Callable's __args__ in collections.abc and typing (GH-23060) https://github.com/python/cpython/commit/463c7d3d149283814d879a9bb8411af64e656c8e

[issue41559] Add support for PEP 612 to typing.py

2020-12-10 Thread Guido van Rossum
Guido van Rossum added the comment: I started doing this in the original code (long ago when PEP 484 was brand new) but have since realized that this makes the typing module both slow and hard to maintain. We should not follow this example. I do think we should try to keep `__args__` hashable

[issue41559] Add support for PEP 612 to typing.py

2020-12-10 Thread Guido van Rossum
Guido van Rossum added the comment: For reference, here's what Pyre has (though it's an older version): https://github.com/facebook/pyre-check/tree/master/pyre_extensions -- ___ Python tracker <https://bugs.python.org/issue41

[issue41559] Add support for PEP 612 to typing.py

2020-12-10 Thread Guido van Rossum
Guido van Rossum added the comment: > class X(Generic[T, P]): ... > > 1. X[int, [int, bool]] raises TypeError because second arg isn't a type (this > is easy to fix). How would you fix it? By just allowing it? But then X.__args__ would be unhashable (see the other issue w

[issue39707] Abstract property setter/deleter implementation not enforced, but documented as such

2020-12-09 Thread Guido van Rossum
Guido van Rossum added the comment: Josh, feel free to submit a PR (make sure it mentions this issue). -- ___ Python tracker <https://bugs.python.org/issue39

[issue41559] Add support for PEP 612 to typing.py

2020-12-09 Thread Guido van Rossum
Guido van Rossum added the comment: I wrote class C(Generic[T, P]): ... and was surprised that C.__parameters__ was (T,) instead of (T, P). -- ___ Python tracker <https://bugs.python.org/issue41

[issue41559] Add support for PEP 612 to typing.py

2020-12-08 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for working on this -- let me know when you have a question for me. Once this is ready we should also add it to the typing_extensions module so people can use it on older Python versions. (https://github.com/python/typing/tree/master

[issue42059] TypedDict(...) as function does not respect "total" when setting __required_keys__ and __optional_keys__

2020-12-07 Thread Guido van Rossum
Guido van Rossum added the comment: Looking for another reviewer. -- ___ Python tracker <https://bugs.python.org/issue42059> ___ ___ Python-bugs-list mailin

[issue42576] Passing keyword arguments to types.GenericAlias causes a hard crash

2020-12-05 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for the quick fix! -- ___ Python tracker <https://bugs.python.org/issue42576> ___ ___ Python-bugs-list mailin

[issue42576] Passing keyword arguments to types.GenericAlias causes a hard crash

2020-12-05 Thread Guido van Rossum
Guido van Rossum added the comment: Oh, this looks like I copied the wrong idiom. Good catch! -- ___ Python tracker <https://bugs.python.org/issue42576> ___ ___

[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2020-12-04 Thread Guido van Rossum
Guido van Rossum added the comment: Wait, is the OP maybe that there’s a difference between typeshed an the stdlib typing.py? -- ___ Python tracker <https://bugs.python.org/issue38

[issue40939] Remove the old parser

2020-12-01 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, I wonder if there's a typo here in pythonrun.c: /* For use in Py_LIMITED_API */ #undef Py_CompileString PyObject * PyCompileString(const char *str, const char *filename, int start) { return Py_CompileStringFlags(str, filename, start, NULL

[issue42474] improve test coverage for TracebackException's __eq__

2020-11-29 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

[issue42474] improve test coverage for TracebackException's __eq__

2020-11-29 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset d82e08d185d52086f4d921c08b853c76c80bebbe by Irit Katriel in branch '3.8': [3.8] bpo-42474: test TracebackException comparison to non-equal instances (GH-23558) https://github.com/python/cpython/commit/d82e08d185d52086f4d921c08b853c76c80bebbe

[issue42474] improve test coverage for TracebackException's __eq__

2020-11-29 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 586bdd1add2ca7236e3096ab7167862cf17f0939 by Irit Katriel in branch '3.9': [3.9] bpo-42474: test TracebackException comparison to non-equal instances (GH-23557) https://github.com/python/cpython/commit/586bdd1add2ca7236e3096ab7167862cf17f0939

[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-11-29 Thread Guido van Rossum
Guido van Rossum added the comment: Now that I've seen and reviewed KJ's implementation using _PosArgs, I am worried about it, as it looks quite complicated. @Shantanu, do we really need to worry that Callable[P, R] could be ambiguous? If P is a ParamSpec, wouldn't Callable[[P], R

[issue42474] improve test coverage for TracebackException's __eq__

2020-11-29 Thread Guido van Rossum
Guido van Rossum added the comment: Irit, can you,do the manual backports? -- ___ Python tracker <https://bugs.python.org/issue42474> ___ ___ Python-bugs-list m

[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Guido van Rossum
Guido van Rossum added the comment: For background, see https://github.com/iritkatriel/cpython/pull/3#issuecomment-734640036 -- it seems the link to exc_traceback was added with little concern for the original design of TracebackExceptionGroup. The question is, can we get rid of it, even

[issue42474] improve test coverage for TracebackException's __eq__

2020-11-27 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 44ca05afc89c9967f5dbc6c3ad89fc298c460e93 by Irit Katriel in branch 'master': bpo-42474: test TracebackException comparison to non-equal instances (GH-23522) https://github.com/python/cpython/commit/44ca05afc89c9967f5dbc6c3ad89fc298c460e93

[issue42468] subprocess.CompletedProcess: Add boolean value

2020-11-25 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker <https://bugs.python.org/issue42468> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42468] subprocess.CompletedProcess: Add boolean value

2020-11-25 Thread Guido van Rossum
Guido van Rossum added the comment: Greg, do you have an opinion here? -- nosy: +gregory.p.smith ___ Python tracker <https://bugs.python.org/issue42468> ___ ___

[issue29980] OSError: multiple exceptions should preserve the exception type if it is common

2020-11-25 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue29980> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42102] Make builtins.callable "generic"

2020-11-23 Thread Guido van Rossum
Guido van Rossum added the comment: No, they both have a different meaning. Object has (almost) no attributes. Any has all attributes. -- ___ Python tracker <https://bugs.python.org/issue42

[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-11-22 Thread Guido van Rossum
Guido van Rossum added the comment: I'm still not sold on __args__ == (Tuple[int, int], str); it looks too weird. However if we introduced a new private type for this purpose that might work? I see that the definition of Tuple in typing.py is Tuple = _TupleType(tuple, -1, inst=False, name

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