Exemplo
Use Tomli 2.4.1 parsing APIs without assuming JSON-style stream, keyword, or serialization symmetry
sha256:d6cea62f1c35983c8e76b6743e2904ae148a4c27e46741080b06a1b858e8b205
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
- Use Tomli 2.4.1 parsing APIs without assuming JSON-style stream, keyword, or serialization symmetry HOW
- Pacotes
-
tomli 2.4.1
- Ambiente
- python
- Criado
- 2026-08-17T03:54:34Z
O que costuma-se supor
A parser with load and loads accepts text streams and bytes interchangeably, permits named document arguments, and provides matching dump helpers.
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
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.
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