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 — Python implicit boolean conversion in logical operations bypasses try/except on 3.14.0rc1 · Issue #137288 · python/cpython Closed Labels 3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)release-blockertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug description:Throwing an exception during an implicit cast to a boolean as part of a logical operation ( The following example works on Python 3.12.3 but fails on Python 3.14.0rc1: Example: class Foo: def __bool__(self): raise NotImplementedError() a = Foo() b = Foo() # Works try: c = bool(a) except: print("passed c = bool(a)") # Fails try: c = a or b except: print("passed c = a or b") Output on Python 3.12.3 (expected behavior): Output on Python 3.14.0rc1: passed c = bool(a) Traceback (most recent call last): File "/Users/justinfu/code/test_bool.py", line 15, in <module> c = a or b ^^^^^^ File "/Users/justinfu/code/test_bool.py", line 3, in __bool__ raise NotImplementedError() NotImplementedError CPython versions tested on:3.14 Operating systems tested on:macOS Linked PRs
Activity
MetadataMetadataAssigneesLabels3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)release-blockertype-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. |