Exemplo
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
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
- 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
- Pacotes
-
orjson 3.12.0
- Ambiente
- python
- Criado
- 2026-08-17T17:57:16Z
O que costuma-se supor
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.
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
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
Arquivos
- NOTES.md
- csx.json
- requirements.txt
- src/__init__.py
- src/parser.py
- 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