[issue41697] Heap buffer overflow in the parser

2020-09-02 Thread Guido van Rossum
Guido van Rossum added the comment: So that's the last line of the new helper function (in fact the end of the file). Maybe args can still be empty at this point? -- assignee: -> pablogsal priority: normal -> release blocker ___ Pyt

[issue41697] Heap buffer overflow in the parser

2020-09-02 Thread Guido van Rossum
Guido van Rossum added the comment: I do have a repro of the crash (with clang 11 no less). But it could be anywhere in sysconfig.py or anything it imports... -- ___ Python tracker <https://bugs.python.org/issue41

[issue41697] Heap buffer overflow in the parser

2020-09-02 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, it's not in sysconfig.py, it's in the next step: ./python.exe -E ./setup.py build -- ___ Python tracker <https://bugs.python.o

[issue41697] Heap buffer overflow in the parser

2020-09-02 Thread Guido van Rossum
Guido van Rossum added the comment: Looking at it in lldb, 'last' seems to be bogus. kind = 6961392 ... lineno = -33686019 col_offset = -33686019 end_lineno = 0 end_col_offset = 0 Here I'm stuck. -- ___ Python

[issue41697] Heap buffer overflow in the parser

2020-09-02 Thread Guido van Rossum
Guido van Rossum added the comment: Adding 3.9 since the offending commit was backported there. -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue41

[issue41697] Heap buffer overflow in the parser

2020-09-02 Thread Guido van Rossum
Guido van Rossum added the comment: Smaller repro: ./python.exe -m configparser Bisection shows that this is the call that causes the crash (line 1301): return _impl(self._name, option, raw=raw, vars=vars, fallback=fallback, **kwargs) But just that line doesn&#

[issue39883] Use BSD0 license for code in docs

2020-09-02 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset e223d06a8b2067c68e9f97c4628c2b0f056dcae6 by Todd in branch 'master': bpo-39883: Use BSD0 license for code in docs (GH-17635) https://github.com/python/cpython/commit/e223d06a8b2067c68e9f97c4628c2b

[issue39883] Use BSD0 license for code in docs

2020-09-03 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset a5d0232b0d2cbcbdeb0d89ea3d8826241a53a7c7 by Miss Islington (bot) in branch '3.9': bpo-39883: Use BSD0 license for code in docs (GH-17635) (GH-22073) https://github.com/python/cpython/commit/a5d0232b0d2cbcbdeb0d89ea3d8826

[issue39883] Use BSD0 license for code in docs

2020-09-03 Thread Guido van Rossum
Guido van Rossum added the comment: Todd, you have a PR for the pydotorg repo as well, right? Can you link it here? -- versions: +Python 3.10, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue39

[issue39883] Use BSD0 license for code in docs

2020-09-03 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 9fef7c54a0adfade5ec94259d97f22e05fe9e3e3 by Miss Islington (bot) in branch '3.8': bpo-39883: Use BSD0 license for code in docs (GH-17635) (GH-22074) https://github.com/python/cpython/commit/9fef7c54a0adfade5ec94259d97f22

[issue41697] Heap buffer overflow in the parser

2020-09-03 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for the report Brad, and thanks for the quick fix Pablo! -- ___ Python tracker <https://bugs.python.org/issue41

[issue41697] Heap buffer overflow in the parser

2020-09-03 Thread Guido van Rossum
Guido van Rossum added the comment: FWIW the bug was a classic type error -- in a decent language the asdl_seq type would have been generic and this would have been caught without an ASAN builder... -- ___ Python tracker <https://bugs.python.

[issue41697] Heap buffer overflow in the parser

2020-09-03 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, I don't believe that will work -- each node type (e.g. `expr_ty`, `mod_ty`) has its own enum for `kind` (e.g. `_expr_kind`, `_mod_kind`) and some don't have a `kind` field at all (e.g. `keyword_ty`). So you'd have to add an extra field to

[issue41411] Improve and consolidate f-strings docs

2020-09-03 Thread Guido van Rossum
Guido van Rossum added the comment: @ezio.melotti: What is this waiting for at this point? There was some good energy here but progress seems halted, waiting for some kind of decision. -- ___ Python tracker <https://bugs.python.org/issue41

[issue41697] Heap buffer overflow in the parser

2020-09-03 Thread Guido van Rossum
Change by Guido van Rossum : -- stage: resolved -> ___ Python tracker <https://bugs.python.org/issue41697> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue38306] High level API for loop.run_in_executor(None, ...)?

2020-09-06 Thread Guido van Rossum
Guido van Rossum added the comment: Really closing. -- nosy: +gvanrossum stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/i

[issue41746] Add optional type information to asdl_seq objects

2020-09-08 Thread Guido van Rossum
Guido van Rossum added the comment: I know it's moot now, but still -- what benefit do we get from using a "standard" like ASDL? All our tooling for it is custom for Python only. -- ___ Python tracker <https://bugs.pyt

[issue41746] Add optional type information to asdl_seq objects

2020-09-08 Thread Guido van Rossum
Guido van Rossum added the comment: I guess some of my gripes about ASDL have to do with our tooling. For example I find it annoying that the 'kind' enums overlap, so if I have a void* that I know points to an AST node I can't look at the kind to tell what it is. Anyway, re

[issue31369] re.RegexFlag is not included in __all__, makes type inference less useful

2020-09-13 Thread Guido van Rossum
Guido van Rossum added the comment: What it prints is irrelevant to static checking. Currently the typeshed stub for the code already exports RegexFlag, so that the following passes mypy but fails at runtime: ``` from re import * def foo(flag: RegexFlag): return match("[a-z]+&q

[issue39883] Use BSD0 license for code in docs

2020-09-14 Thread Guido van Rossum
Guido van Rossum added the comment: This looks fully resolved. Thanks again Todd! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41780] Generic Alias attributes nor in dir()

2020-09-14 Thread Guido van Rossum
Guido van Rossum added the comment: I actually have no idea where dir() gets its information. IIRC the implementation was a collaboration with Batuhan -- @Batuhan, do you want to look into this? Presumably some metadata needs to be added to genericaliasobject.c. -- nosy

[issue41780] Generic Alias attributes nor in dir()

2020-09-15 Thread Guido van Rossum
Guido van Rossum added the comment: The forwarding of `__class__`, and the resulting difference between `type(list[int])` and `list[int].__class__` are intentional. I think overriding `__dir__` along the lines suggested by Allan (but in C of course) would be the best solution

[issue41780] Generic Alias attributes nor in dir()

2020-09-15 Thread Guido van Rossum
Change by Guido van Rossum : -- assignee: docs@python -> stage: -> needs patch ___ Python tracker <https://bugs.python.org/issue41780> ___ ___ Pyth

[issue41780] Generic Alias attributes nor in dir()

2020-09-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

[issue41792] No (public) way to dynamically introspect if an annotation is a TypedDict

2020-09-15 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 0705ec8a149e27023b0420ae0366d16255f6c9f7 by Patrick Reader in branch 'master': bpo-41792: Add is_typeddict function to typing.py (GH-22254) https://github.com/python/cpython/commit/0705ec8a149e27023b0420ae0366d16255f6c9f7 -

[issue41792] No (public) way to dynamically introspect if an annotation is a TypedDict

2020-09-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

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-16 Thread Guido van Rossum
Guido van Rossum added the comment: Thomas, can you explain the problem in English? Those elaborate test programs don’t do it for me, sorry. -- ___ Python tracker <https://bugs.python.org/issue41

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-16 Thread Guido van Rossum
Guido van Rossum added the comment: Okay, I got it. Now my next question. What do you mean by "I've eliminated runpy" and various other remarks along those lines? Have you actually identified the root cause of the problem? What's your suggested fix (wit

[issue40697] add fissix as a lib2to3 alternative

2020-09-16 Thread Guido van Rossum
Guido van Rossum added the comment: Closing for lack of activity. -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue40697> ___ ___ Python-bug

[issue37604] warnings should use a ContextVar to manage filters/registry

2020-09-16 Thread Guido van Rossum
Guido van Rossum added the comment: Closing for lack of activity. -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue37604> ___ ___ Python-bug

[issue37350] print ResourceWarning object traceback when raised as error with -W error and -X tracemalloc

2020-09-16 Thread Guido van Rossum
Guido van Rossum added the comment: Closing for lack of activity. -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue37350> ___ ___ Python-bug

[issue36586] multiprocessing.Queue.close doesn't behave as documented

2020-09-16 Thread Guido van Rossum
Guido van Rossum added the comment: Closing for lack of activity. -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue36586> ___ ___ Python-bug

[issue36586] multiprocessing.Queue.close doesn't behave as documented

2020-09-16 Thread Guido van Rossum
Change by Guido van Rossum : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue36586> ___ ___ Python-bugs-list

[issue37350] print ResourceWarning object traceback when raised as error with -W error and -X tracemalloc

2020-09-16 Thread Guido van Rossum
Change by Guido van Rossum : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue37350> ___ ___ Python-bugs-list

[issue37604] warnings should use a ContextVar to manage filters/registry

2020-09-16 Thread Guido van Rossum
Change by Guido van Rossum : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue37604> ___ ___ Python-bugs-list

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-16 Thread Guido van Rossum
Guido van Rossum added the comment: Okay, so according to eryksun the fix requires C code. @graingert, are you interested in developing such a fix? Or @eryksun do you have an idea on how to fix it? -- ___ Python tracker <https://bugs.python.

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-16 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks, I think this is the fix: diff --git a/Modules/main.c b/Modules/main.c index 4a76f4461b..3d1bbee3a0 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -288,6 +288,10 @@ pymain_run_module(const wchar_t *modname, int set_argv0) return

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-16 Thread Guido van Rossum
Change by Guido van Rossum : -- stage: patch review -> needs patch versions: +Python 3.10 ___ Python tracker <https://bugs.python.org/issue41602> ___ ___ Py

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-16 Thread Guido van Rossum
Guido van Rossum added the comment: Why did you remove 3.10? -- ___ Python tracker <https://bugs.python.org/issue41602> ___ ___ Python-bugs-list mailin

[issue35293] make doctest (Sphinx) emits a lot of warnings

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

[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-09-19 Thread Guido van Rossum
Guido van Rossum added the comment: Let’s do this. -- ___ Python tracker <https://bugs.python.org/issue41810> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-09-19 Thread Guido van Rossum
Guido van Rossum added the comment: > Would not be better to make MyPy supporting type(Ellipsis)? It would work > also on Python versions older than 3.10. That would be quite complicated. There is no place in annotations where a function call is currently supported, so I'd prefe

[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-09-21 Thread Guido van Rossum
Guido van Rossum added the comment: I’m okay with adding those (even though NoneType might not work in mypy, given the special-casing for None, per PEP 484). -- ___ Python tracker <https://bugs.python.org/issue41

[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-09-21 Thread Guido van Rossum
Guido van Rossum added the comment: > In any case, I'm ok with adding `NoneType` and `NotImplementedType` to the PR. Please do. -- ___ Python tracker <https://bugs.python.org

[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-09-21 Thread Guido van Rossum
Guido van Rossum added the comment: Bas can you do some research to answer Eric's question? In theory it should be possible to use git bisect to find it. I see it in 2.7 but not in 3.4. That's a fairly large interval, alas. -- ___ Pyth

[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-09-21 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! Most of the deleted types *are* builtins (e.g. object, int). I assume the reasoning was just that if you wanted the type you could just write type(Ellipsis), type(None) etc. But that's too dynamic for static checkers, so we want *some* stable

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

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

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-22 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset a68a2ad19c891faa891904b3da537911cc77df21 by Thomas Grainger in branch 'master': bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (#21956) https://github.com/python/cpyt

[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

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

[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-09-22 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 0d0e9fe2ffc1683758a1985ef6dedeef5ecafdbc by Bas van Beek in branch 'master': bpo-41810: Reintroduce `types.EllipsisType`, `.NoneType` & `.NotImplementedType` (GH-22336) https://github.com/python/

[issue41848] PEG parser doesn't allow lambda in for_if_clause

2020-09-25 Thread Guido van Rossum
Guido van Rossum added the comment: I propose not to fix this, since it is pointless (a lambda is always truthy). We can call it out in What's New in 3.9 -- as a very small footnote. :-) -- ___ Python tracker <https://bugs.python.org/is

[issue41848] PEG parser doesn't allow lambda in for_if_clause

2020-09-26 Thread Guido van Rossum
Guido van Rossum added the comment: Okay, let's close this. -- resolution: -> wont fix stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue41872] get_type_hints fails to resolve forward references in nested function

2020-09-27 Thread Guido van Rossum
Guido van Rossum added the comment: This cannot be helped (unless we were to add an ugly sys._getframe() call to get_type_hints(), which I don't want to do). The solution is to pass `localns=locals()`, e.g. get_type_hints(foo, None, locals()) or get_type_hints(foo, localns=l

[issue41872] get_type_hints fails to resolve forward references in nested function

2020-09-27 Thread Guido van Rossum
Guido van Rossum added the comment: I've only seen it in test cases too -- that's one of the very few situations where it makes sense to define a class inside a function. (Creating a class is an expensive operation, so any function that expects to be called more than once is better

[issue41897] ast.parse in Python 3.9 does not produce SyntaxError for assignment to __debug__

2020-09-30 Thread Guido van Rossum
Guido van Rossum added the comment: We moved the check from the parser to the bytecode compiler. I don't think this should be a problem. Kudos for noticing though! :-) ``` >>> compile("__debug__ = 1", "", "exec") Traceback (most recent call las

[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-09-30 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, I'm not sure. ast.literal_eval() does accept trailing whitespace, and embedded whitespace. ``` >>> ast.literal_eval("- ( 1\n)\n") -1 >>> ``` So I think it should start accepting leading whitespace too (but on

[issue17490] Improve ast.literal_eval test suite coverage

2020-10-01 Thread Guido van Rossum
Guido van Rossum added the comment: I agree that it's better to just close this issue, the patch is 7 years old. -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/is

[issue17490] Improve ast.literal_eval test suite coverage

2020-10-01 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, I don't think PR 22469 is relevant to this issue? -- ___ Python tracker <https://bugs.python.org/issue17490> ___ ___

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-02 Thread Guido van Rossum
Guido van Rossum added the comment: I'm going to ignore this issue until you two have reached agreement. I recommend using some example code. -- ___ Python tracker <https://bugs.python.org/is

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-02 Thread Guido van Rossum
Guido van Rossum added the comment: I still like to have a helper that recalculates the abstractness status of a class after adding some new methods (or deleting some). I would prefer the isinstance(cls, ABCMeta) check to be inside that helper, so that you could call it unconditionally

[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-10-02 Thread Guido van Rossum
Guido van Rossum added the comment: [Terry] > But why should not parsing remove indents for 'eval' mode? I dunno, but it's been doing this since 1992, so I think it would be fragile to change. The best thing therefore is to make ast.literal_eval(

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Guido van Rossum
Guido van Rossum added the comment: Why would that require more code? That’s already how it worked. Maybe you misunderstand what I tried to say? -- ___ Python tracker <https://bugs.python.org/issue41

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Guido van Rossum
Guido van Rossum added the comment: Ah, okay. I wasn't familiar with @total_ordering so I assumed differently. Sorry for the continued misunderstanding. Perhaps we should just leave it alone completely then, since ISTM that any change to its implementation may cause subtle bu

[issue41923] Add PEP 613 typing.TypeAlias to the standard library

2020-10-03 Thread Guido van Rossum
Guido van Rossum added the comment: Sure go right ahead. -- ___ Python tracker <https://bugs.python.org/issue41923> ___ ___ Python-bugs-list mailing list Unsub

[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-03 Thread Guido van Rossum
Guido van Rossum added the comment: I don't think I remember what's so special about abstract_get_bases() to disable the recursion check. Maybe this macro is always just a micro-optimization? Then again it's hard to be sure, the behavior may depend on the platform. Pulling

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, you're effectively proposing to compute (or update) __abstractmethods__ lazily. There are a number of subtleties with that, e.g. __abstractmethods__ is currently a frozenset, and a base class's __abstractmethods__ is used when com

[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-10-03 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset e799aa8b92c195735f379940acd9925961ad04ec by Batuhan Taskaya in branch 'master': bpo-41887: omit leading spaces/tabs on ast.literal_eval (#22469) https://github.com/python/cpython/commit/e799aa8b92c195735f379940acd992

[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-10-03 Thread Guido van Rossum
Guido van Rossum added the comment: Closing. Let’s not backport. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Guido van Rossum
Guido van Rossum added the comment: Yes, we could override ABCMeta.__setattr__ to do that. Though it seems this class is considered performance sensitive (else why have Modules/_abc.c) we would probably have to write it in C.-- --Guido (mobile

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2020-10-04 Thread Guido van Rossum
Guido van Rossum added the comment: Possibly at some point in the future we can switch to using typing.Protocol, which requires neither registration nor explicit subclassing (it's like Hashable). This makes it easy for user code to define custom protocols as needed. So if you need some

[issue41428] PEP 604 -- Allow writing union types as X | Y

2020-10-04 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 8e1dd55e63d18d40e78d941fc9233d2c77bcd3de by Fidget-Spinner in branch 'master': bpo-41428: Documentation for PEP 604 (gh-22517) https://github.com/python/cpython/commit/8e1dd55e63d18d40e78d941fc9233d2c77bcd3de -- nosy: +

[issue41428] PEP 604 -- Allow writing union types as X | Y

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

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2020-10-06 Thread Guido van Rossum
Change by Guido van Rossum : -- assignee: gvanrossum -> rhettinger nosy: -gvanrossum ___ Python tracker <https://bugs.python.org/issue26680> ___ ___ Python-

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

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

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-06 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset bef7d299eb911086ea5a7ccf7a9da337e38a8491 by Ben Avrahami in branch 'master': bpo-41905: Add abc.update_abstractmethods() (GH-22485) https://github.com/python/cpython/commit/bef7d299eb911086ea5a7ccf7a9da3

[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-10-06 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 044a1048ca93d466965afc027b91a5a9eb9ce23c by Batuhan Taskaya in branch 'master': bpo-38605: Make 'from __future__ import annotations' the default (GH-20434) https://github.com/python/cpython/commit/044a1048ca93d466965a

[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-10-06 Thread Guido van Rossum
Guido van Rossum added the comment: I'm marking this fixed, but there are some subtle edge cases. That's what alpha releases are for. @BTaskaya, adding those arguments to various inspect functions sounds like a nice thing to do. You could either open a new issue or just refe

[issue41967] Handle annotations in the parser to avoid the need for roundtrip

2020-10-07 Thread Guido van Rossum
Guido van Rossum added the comment: What's the issue exactly with multi-line annotations? Is it that they can't be parsed by eval()? Could that be fixed by replacing comments and newlines with spaces? (Either in the parser or in get_type_hints() -- actually ForwardRef._evaluat

[issue41967] Handle annotations in the parser to avoid the need for roundtrip

2020-10-07 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, this buffer thing is not what I had expected. I think it's a show-stopper -- if we don't reproduce spaces exactly. Maybe we should just buffer the entire input always? A way to handle multi-line annotations would be to surround them with p

[issue41967] Handle annotations in the parser to avoid the need for roundtrip

2020-10-07 Thread Guido van Rossum
Guido van Rossum added the comment: I know the final result is the same (i.e. the AST is identical and the string differs only in the use of whitespace). I just wonder why bother changing this unless we reproduce the spaces in the string exactly

[issue41967] Handle annotations in the parser to avoid the need for roundtrip

2020-10-07 Thread Guido van Rossum
Guido van Rossum added the comment: Okay, but doesn't *any* way of handling multi-line annotations spoil the wins? We cannot declare those illegal. (Though we can switch to a different way of representing those.) -- ___ Python tracker &

[issue41967] Handle annotations in the parser to avoid the need for roundtrip

2020-10-07 Thread Guido van Rossum
Guido van Rossum added the comment: > the string generated for multi line annotations [...] won't have spaces > between characters. Okay, though aren't there cases where spaces are necessary? E.g. between names or between a name or keyword and a string or number. Assumin

[issue41923] Add PEP 613 typing.TypeAlias to the standard library

2020-10-07 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 4f3c25043d651a13c41cffcee703f7d5cb677cc7 by Mikhail Golubev in branch 'master': bpo-41923: PEP 613: Add TypeAlias to typing module (#22532) https://github.com/python/cpython/commit/4f3c25043d651a13c41cffcee703f7

[issue41923] Add PEP 613 typing.TypeAlias to the standard library

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

[issue41967] Handle annotations in the parser to avoid the need for roundtrip

2020-10-07 Thread Guido van Rossum
Guido van Rossum added the comment: Too bad. :-( -- ___ Python tracker <https://bugs.python.org/issue41967> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34552] Clarify built-in types comparisons

2020-10-08 Thread Guido van Rossum
Guido van Rossum added the comment: Yup. Thanks for catching this! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-10-09 Thread Guido van Rossum
Guido van Rossum added the comment: This behavior (only relevant with `from __future__ import annotations`) has been around since @singledispatchmethod was introduced in 3.8, so I agree we should treat it as a feature request. In the meantime, maybe a workaround is to move the register call

[issue40814] Update typing module documentation based on PEP 585

2020-10-09 Thread Guido van Rossum
Guido van Rossum added the comment: Yes, let’s document __args__ and __origin__. -- ___ Python tracker <https://bugs.python.org/issue40814> ___ ___ Python-bug

[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-10-10 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 0ae216b11644b23511c6287a52e7d28aeb9f by Batuhan Taskaya in branch 'master': bpo-38605: bump the magic number for 'annotations' future (#22630) https://github.com/python/cpython/commit/0ae216b11644b235

[issue42017] Add new type in typing

2020-10-12 Thread Guido van Rossum
Guido van Rossum added the comment: You can easily define that yourself if you need it, though honestly the utility seems marginal. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bug

[issue42010] Generic types accept indexing/subscripting, causing confusion

2020-10-12 Thread Guido van Rossum
Guido van Rossum added the comment: Have you observed actual users getting confused by this? (E.g. StackOverflow or mailing list posts.) I would assume that if you try to *do* anything with the resulting object it's going to cause a traceback, and from there it's pretty straight

[issue39481] Implement PEP 585 (Type Hinting Generics In Standard Collections)

2020-10-12 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 1c217652b690c184b43d8e2b6529a60a14e64328 by Saiyang Gou in branch '3.9': [3.9] bpo-39481: Fix duplicate SimpleQueue type in test_genericalias.py (GH-22619) (#22624) https://github.com/python/cpyt

[issue42010] Generic types accept indexing/subscripting, causing confusion

2020-10-16 Thread Guido van Rossum
Guido van Rossum added the comment: That sentence has been a lie for a long time (from the start?). Any type can define __getitem__ and get this behavior, though in this case it is done through __class_getitem__ (PEP NNN). -- ___ Python tracker

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

2020-10-17 Thread Guido van Rossum
Guido van Rossum added the comment: Can you submit a PR to fix this? It looks like you already have a good understanding of the root cause of the problem, so it should be easy to fix. (Be sure to add a unit test.) It can be backported to earlier Python versions that have typing.TypedDict

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

2020-10-17 Thread Guido van Rossum
Guido van Rossum added the comment: Whoops, sorry, didn't see that you already have a PR. I'll review it next week during the core sprint. -- ___ Python tracker <https://bugs.python.o

[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-17 Thread Guido van Rossum
Guido van Rossum added the comment: This may be irrelevant at this point, but trying to understand the original reproducer, I wanted to add my 1c worth. It seems Dennis' reproducer.py is roughly this: (I'm renaming BIG//3 to K to simplify the math.) aBaBBB

[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-17 Thread Guido van Rossum
Guido van Rossum added the comment: Right, so IIUC the *quadratic* portion of Dennis’ original reproducer, aBaBBB with pattern BBB, except with more cowbell :-) acts the same. -- ___ Python tracker <https://bugs.python.org/issue41

[issue37105] Add deprecated-remove information on stream doc

2020-10-20 Thread Guido van Rossum
Guido van Rossum added the comment: I'd say close it, the deprecation can be a separate issue (usually is) and I don't think we need to backport such a minor docs issue to 3.8. The PR is old enough that it made 3.9+3.10 I think (did you check?). -- nosy: +

[issue37105] Add deprecated-remove information on stream doc

2020-10-20 Thread Guido van Rossum
Guido van Rossum added the comment: Whoops, never mind me. Irit can you friend me on Discourse? -- ___ Python tracker <https://bugs.python.org/issue37

[issue42010] Generic types accept indexing/subscripting, causing confusion

2020-10-20 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 7cdf30fff39ea97f403b5472096349998d190e30 by kj in branch 'master': bpo-42010: [docs] Clarify subscription of types (GH-22822) https://github.com/python/cpython/commit/7cdf30fff39ea97f403b5472096349

<    26   27   28   29   30   31   32   33   34   35   >