GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — All instances of `types.GenericAlias` are iterable on Python 3.11+ · Issue #103450 · python/cpython Closed as not planned Closed as not planned Copy link Labels 3.11only security fixesonly security fixes3.12only security fixesonly security fixestopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionAll generic aliases appear to be iterable on Python 3.11+, meaning you can do some fairly bizarre things that don't really make any sense: >>> list(dict[int, int]) [*dict[int, int]] >>> import collections.abc >>> list(collections.abc.Generator[int, str, bytes]) [*collections.abc.Generator[int, str, bytes]] This is due to the implementation of PEP 646 that was added in #31019 by @mrahtz. It was a deliberate decision at the time: 4aa94df is the commit in that PR branch that removes the restriction that only Do we want to stick with this behaviour, on the basis that the runtime usually prefers to be lenient when it comes to typing constructs, leaving it to type checkers to point out invalid usage? Or should this be considered a bug? Activity
MetadataMetadataAssigneesLabels3.11only security fixesonly security fixes3.12only security fixesonly security fixestopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |