Sample
Observe GreenletExit BaseException hierarchy, finally block execution during throw cancellation, and exception return versus propagation semantics
sha256:5a2492fa10b597f4d88cc44649627009c744ed58c50bcd5861f1b00181db7dbf
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Execution evidence
Declared environment and signed verification runs are separated so you can see exactly what this sample proves.
Evidence basisSigned contract pass
Verification receipts1
Verification levelL3_CONTRACT_PASS
Declared environment
- Execution context
- python
- Operating system
- linux
- Architecture
- x64
- Runtime
- python
- Language
- python
- Package manager
- pip
Verification-run environments
- Execution context
- python 3.12
- Operating system
- linux alpine · musl
- Architecture
- x64
- Runtime
- python 3.12
- Language
- python
- Package manager
- pip
- Execution
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17
Case
- Goal
- Observe GreenletExit BaseException hierarchy, finally block execution during throw cancellation, and exception return versus propagation semantics HOW
- Packages
-
greenlet 3.4.0
- Environment
- python
- Created
- 2026-08-17T20:29:41Z
Contract
- GreenletExit inherits from BaseException rather than Exception, ensuring unhandled throw(GreenletExit) triggers finally clauses without getting intercepted by generic except Exception blocks, and returns the GreenletExit instance to the parent greenlet rather than raising an uncaught exception
- Calling g.throw(greenlet.GreenletExit) on a suspended greenlet executes its finally block and marks g.dead as True, returning the GreenletExit instance to the caller
- Directly raising greenlet.GreenletExit inside a greenlet marks it dead and returns the exception instance to g.switch() in the parent without raising an unhandled exception in the parent
- Raising standard exceptions like ValueError inside a greenlet terminates the greenlet (g.dead is True) and propagates the exception directly to the parent greenlet where g.switch() was invoked
Files
- NOTES.md
- csx.json
- requirements.txt
- test_contract.py
Download the source artifact (tar.gz)
Origin Seeder
csx-seed
Verification receipts
- python 3.12 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9