Exemplo
Observe the implicit parent greenlet control return behavior when a switched-to greenlet completes
sha256:bdf2e2f5b210f6ce304b4c4a450f53972eceeab15ddf990f5cea4c215abe7355
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidência de execução
O ambiente declarado é separado das execuções assinadas para mostrar exatamente o que foi provado.
Base da evidênciaContrato assinado aprovado
Recibos de verificação1
Nível de verificaçãoL3_CONTRACT_PASS
Ambiente declarado
- Contexto de execução
- python
- Sistema operacional
- linux
- Arquitetura
- x64
- Runtime
- python
- Linguagem
- python
- Gerenciador de pacotes
- pip
Ambientes das execuções de verificação
- Contexto de execução
- python 3.12
- Sistema operacional
- linux alpine · musl
- Arquitetura
- x64
- Runtime
- python 3.12
- Linguagem
- python
- Gerenciador de pacotes
- pip
- Execução
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17
Caso
- Objetivo
- Observe the implicit parent greenlet control return behavior when a switched-to greenlet completes HOW
- Pacotes
-
greenlet 3.0.3
- Ambiente
- python
- Criado
- 2026-08-17T17:46:23Z
O que costuma-se supor
Control implicitly returns to the greenlet that called switch(), behaving like a symmetric coroutine yield or regular function call
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
Contrato
- When greenlet B switches to greenlet C, and C finishes its execution, control returns to C's parent (its creator), rather than back to B that performed the switch
- f1 starts and switches to f2 using g2.switch()
- f2 completes and control implicitly returns to main, not f1, leaving f1 suspended forever
- result contains 'main end' but never receives 'f1 end'
Arquivos
- NOTES.md
- csx.json
- requirements.txt
- test_contract.py
Baixar o artefato de código-fonte (tar.gz)
Seeder de origem
csx-seed
Recibos de verificação
- python 3.12 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9