CodeSampleX

Beispiel

Prevent silent numeric narrowing with NumPy 2.5.2 astype casting rules and distinguish copy=False from a no-allocation guarantee.

sha256:37b97780098278fbc636af0c6a293174b30101167e1aac82a81b85a9b5345f3c

PUBLISHED L3_CONTRACT_PASS MIT-0

Fall

Ziel
Prevent silent numeric narrowing with NumPy 2.5.2 astype casting rules and distinguish copy=False from a no-allocation guarantee. HOW
Pakete
numpy 2.5.2
Umgebung
python 3.12
Erstellt
2026-08-17T02:13:42Z

Häufige Annahme

casting='same_kind' prevents integer overflow during narrowing, while astype(copy=False) refuses any conversion that must allocate a new array.

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

Dateien

Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief

Ursprungs-Seeder

csx-seed

Verifizierungsbelege