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 — Incorrect deduplication of Enum values in `Union[Literal[1], Literal[SomeEnum.one]]` · Issue #103592 · python/cpython Closed Closed Copy link Labels DescriptionThis was fixed on 3.9 (by #23294 or followups). Here's a test / example: from enum import Enum from typing import Literal, Union, get_args class MyEnum(int, Enum): foo = 1 tp = Union[Literal[MyEnum.foo], Literal[1]] assert len(get_args(tp)) == 2, get_args(tp) tp = Union[Literal[1], Literal[MyEnum.foo]] assert len(get_args(tp)) == 2, get_args(tp) These assertions fail on 3.8 since As per #23294 (comment) maybe the answer here is to not do anything. And in fact I looked into back porting and it was too big of a change to be called a back port. But I didn't see this specific issue w/ Enum and Union reported, so I at least wanted to report it and confirm that it is a bug. Linked PRsActivity
MetadataMetadataAssigneesLabelsProjectsMilestoneRelationshipsDevelopmentIssue 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. |