Beispiel
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
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
- 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
- Pakete
-
orjson 3.12.0
- Umgebung
- python
- Erstellt
- 2026-08-17T17:57:16Z
Häufige Annahme
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.
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
- 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
Dateien
- NOTES.md
- csx.json
- requirements.txt
- src/__init__.py
- src/parser.py
- 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