CodeSampleX

Beispiel

orjson 3.12.0: Configure orjson option bitmasks to intercept subclasses, dataclasses, naive timestamps, and JS-safe integers that default serialization silently bypasses or corrupts

Verifiziertes Beispiel für pypi orjson 3.12.0: Configure orjson option bitmasks to intercept subclasses, dataclasses, naive timestamps, and JS-safe integers…

sha256:05f2672095e6b40251604acdb3f1cf2defa139aa701bc9f92f5d48baa62b229e

Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen. Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen. MIT-0

Ausführungsbelege

Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.

Beleggrundlage
Signierter Vertrag bestanden
Verifizierungsbelege
2
Signaturschlüssel, die es gebaut haben
2
Deklarierte Umgebung python linux x64 python python pip

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
python 3.12 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-16
python 3.12 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-18

Fall

HOW
Ziel
Configure orjson option bitmasks to intercept subclasses, dataclasses, naive timestamps, and JS-safe integers that default serialization silently bypasses or corrupts
Pakete
Symbole
  • orjson.dumps
  • orjson.loads
  • orjson.Fragment
  • orjson.OPT_PASSTHROUGH_SUBCLASS
  • orjson.OPT_PASSTHROUGH_DATACLASS
  • orjson.OPT_PASSTHROUGH_DATETIME
  • orjson.OPT_STRICT_INTEGER
  • orjson.OPT_NAIVE_UTC
  • orjson.OPT_UTC_Z
  • orjson.OPT_APPEND_NEWLINE
Umgebung
python
Erstellt
2026-08-16T07:09:11Z

Contract

  1. assert primitive subclasses bypass the default hook and serialize raw unless OPT_PASSTHROUGH_SUBCLASS is set
  2. assert dataclasses bypass the default hook and serialize all fields natively unless OPT_PASSTHROUGH_DATACLASS is set
  3. assert datetime objects bypass the default hook unless OPT_PASSTHROUGH_DATETIME is set
  4. assert OPT_UTC_Z alone has no effect on naive datetimes, requiring OPT_NAIVE_UTC composed via bitwise OR to emit Zulu format
  5. assert integers within 53-bit range serialize under OPT_STRICT_INTEGER while integers exceeding 2**53-1 raise TypeError
  6. assert orjson.Fragment splices raw buffers zero-copy and raises TypeError during dumps if the content is not bytes or str
  7. assert dumps parameter is singular 'option' raising TypeError on 'options', and invalid bitmasks raise TypeError
  8. assert OPT_APPEND_NEWLINE writes a trailing newline and composed options execute simultaneously in a single dumps pass

Dateien

  • NOTES.md
  • csx.json
  • requirements.txt
  • src/__init__.py
  • src/config.py
  • test/contract.py

Quellartefakt herunterladen (tar.gz)

Ursprungs-Seeder

csx-seed