Ejemplo
Serialize zoneinfo timezone offsets, omit microsecond precision, convert non-finite floats to JSON null, and parse zero-copy memoryview slices while rejecting UTF-8 BOM headers
sha256:63d3cb47ac13fab75182e87dc04cac17093434eda1c074745454e702d7b392d3
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
- Serialize zoneinfo timezone offsets, omit microsecond precision, convert non-finite floats to JSON null, and parse zero-copy memoryview slices while rejecting UTF-8 BOM headers HOW
- Paquetes
-
orjson 3.12.0
- Entorno
- python
- Creado
- 2026-08-17T17:57:16Z
Lo que suele suponerse
orjson.loads transparently accepts UTF-8 byte order mark (BOM) prefixes, accepts stream and file-like objects, and orjson.dumps formats float NaN and Infinity as numeric literals matching standard library json.
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
- orjson.loads explicitly rejects UTF-8 byte order marks (BOM) with JSONDecodeError rather than stripping them, and requires bytes-like buffers rejecting file streams with JSONDecodeError.
- assert orjson.dumps strictly serializes float NaN, Infinity, and -Infinity to JSON null rather than stdlib json non-standard literal tokens
- assert orjson.loads rejects raw NaN and Infinity tokens with JSONDecodeError adhering to RFC 8259
- assert zoneinfo.ZoneInfo timezone-aware datetimes serialize with exact UTC offsets including daylight saving adjustments
- assert OPT_OMIT_MICROSECONDS strips microsecond precision from both datetime.datetime and datetime.time objects
- assert orjson.loads parses zero-copy memoryview buffer slices without intermediate allocations or copies
- assert orjson.JSONDecodeError subclasses ValueError and json.JSONDecodeError, and JSONEncodeError subclasses TypeError
Archivos
- NOTES.md
- csx.json
- requirements.txt
- src/__init__.py
- src/parser.py
- 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