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 — [2.2 regression] unreachable code regression with custom equality enum membership check · Issue #21703 · python/mypy Closed Labels bugmypy got something wrong DescriptionBug Report Mypy 2.2.0 introduced a regression from 2.1.0 with equality comparisons with custom integer enums. Using the config option despite the code actually hitting this path at runtime and printing "Success". To Reproduce #!/usr/bin/env python3 import enum import sys import typing class E(enum.Enum): foo = 1 bar = 2 def __int__(self) -> int: return int(self.value) def __eq__(self, other: typing.Any) -> bool: return bool(int(self) == other) class Test: def __init__(self) -> None: self.val: int = 1 t = Test() if t.val in [E.foo, E.bar]: print("success") sys.exit(0) print("fail") sys.exit(1) Your Environment
Activity
MetadataMetadataAssigneesLabelsbugmypy got something wrong ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — 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. |