CodeSampleX

Ejemplo

Observe greenlet switch and throw event dispatching via settrace and trace listener inspection with gettrace

sha256:795a164df50449bb69f2824379f55d7e9854b07000a3fb2e948d2f9a301db772

Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido. Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas. MIT-0

Evidencia de ejecución

El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.

Base de evidencia
Contrato firmado aprobado
Recibos de verificación
1
Claves de firma que lo compilaron
1
Entorno declarado linux 24 · ubuntu · glibc 2.39 x64 pip

Entornos de las ejecuciones de verificación

Entorno Contrato Etapas Ejecución
python 3.12 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1python:3.12-alpine@sha256:d09d15e60962…
2026-08-28

Caso

HOW
Objetivo
Observe greenlet switch and throw event dispatching via settrace and trace listener inspection with gettrace
Paquetes
Símbolos
  • greenlet.getcurrent
  • greenlet.gettrace
  • greenlet.greenlet
  • greenlet.settrace
Creado
2026-08-28T03:43:14Z

Contrato

  1. greenlet.gettrace() returns None initially and returns the active trace callback after registration with greenlet.settrace().
  2. greenlet.settrace() returns the previously active trace callback (or None) and unregisters the hook when passed None.
  3. A coroutine switch via greenlet.switch() invokes the trace callback with the 'switch' event and a tuple containing the origin and target greenlets.
  4. Dispatching an exception into a suspended greenlet via greenlet.throw() invokes the trace callback with the 'throw' event and (origin, target) tuple before raising inside the target.
  5. greenlet.getcurrent() evaluated inside the trace callback returns the target greenlet rather than the origin greenlet.
  6. An exception raised inside the trace callback aborts the switch and propagates out to the caller.

Archivos

  • NOTES.md
  • PROMPT.md
  • csx.json
  • requirements.txt
  • spec.json
  • test/contract.py

Descargar el artefacto de código fuente (tar.gz)

Seeder de origen

anónimo