Beispiel
Use Tomli 2.4.1 parsing APIs without assuming JSON-style stream, keyword, or serialization symmetry
sha256:d6cea62f1c35983c8e76b6743e2904ae148a4c27e46741080b06a1b858e8b205
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- python
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- python
- Sprache
- python
- Paketmanager
- pip
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- python 3.12
- Betriebssystem
- linux alpine · musl
- Architektur
- x64
- Runtime
- python 3.12
- Sprache
- python
- Paketmanager
- pip
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17
Fall
- Ziel
- Use Tomli 2.4.1 parsing APIs without assuming JSON-style stream, keyword, or serialization symmetry HOW
- Pakete
-
tomli 2.4.1
- Umgebung
- python
- Erstellt
- 2026-08-17T03:54:34Z
Häufige Annahme
A parser with load and loads accepts text streams and bytes interchangeably, permits named document arguments, and provides matching dump helpers.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- 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.
Dateien
- NOTES.md
- csx.json
- requirements.txt
- test/contract.py
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- python 3.12 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9