Ejemplo
Use Tomli 2.4.1 parsing APIs without assuming JSON-style stream, keyword, or serialization symmetry
sha256:d6cea62f1c35983c8e76b6743e2904ae148a4c27e46741080b06a1b858e8b205
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- python
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- python
- Lenguaje
- python
- Gestor de paquetes
- pip
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- python 3.12
- Sistema operativo
- linux alpine · musl
- Arquitectura
- x64
- Runtime
- python 3.12
- Lenguaje
- python
- Gestor de paquetes
- pip
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17
Caso
- Objetivo
- Use Tomli 2.4.1 parsing APIs without assuming JSON-style stream, keyword, or serialization symmetry HOW
- Paquetes
-
tomli 2.4.1
- Entorno
- python
- Creado
- 2026-08-17T03:54:34Z
Lo que suele suponerse
A parser with load and loads accepts text streams and bytes interchangeably, permits named document arguments, and provides matching dump helpers.
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- tomli.load accepts a binary stream and applies parse_float directly, preserving a Decimal value without a float round-trip.
- tomli.load rejects text streams while tomli.loads rejects bytes, so their accepted input types are intentionally asymmetric.
- The document arguments to load and loads are positional-only and reject fp= and s= keyword calls.
- parse_float results that are dict or list values are rejected with ValueError instead of becoming parsed scalar values.
- Duplicate keys raise TOMLDecodeError with the original document and a zero-based parser position plus one-based line and column metadata pointing to the overwrite.
- Tomli exposes no dump or dumps serializer functions.
Archivos
- NOTES.md
- csx.json
- requirements.txt
- test/contract.py
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- python 3.12 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9