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 — enum.CONFORM behavior breaks backwards compatibility · Issue #103365 · python/cpython Closed Labels stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionEncountered yet another breaking change for enums. There are two problems here:
Example to reproduce: import enum class SkipFlag(enum.Flag): A = 1 B = 2 C = 4 | B print(SkipFlag.C in (SkipFlag.A|SkipFlag.C)) class SkipIntFlag(enum.IntFlag): A = 1 B = 2 C = 4 | B print(SkipIntFlag.C in (SkipIntFlag.A|SkipIntFlag.C)) print(SkipIntFlag(42).value) print(SkipFlag(42).value) In Python 3.10.6, this code outputs: In Python 3.11.2: Having such members as C is useful to create a flags that are distinct from B but always implies B. In a previous comment bug report it was stated that the previous behavior of Flag was CONFORM:
Originally posted by @ethanfurman in #96865 (comment) Clearly this is incorrect. The previous behavior was more similar to STRICT, but there appears to be no precise equivalent in Python 3.11 to the old behavior. Using STRICT in Python 3.11, Linked PRsActivity
MetadataMetadataAssigneesLabelsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error Projects
MilestoneRelationshipsDevelopmentIssue 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. |