Phantom Types for Python
JSON →phantom-types is a Python library that enables the creation of 'phantom types' to enforce type safety at compile time without incurring runtime overhead. It leverages Python's `__instancecheck__` protocol and boolean predicates to allow developers to define stricter type constraints, helping to make 'illegal states unrepresentable' and mitigate 'shotgun parsing'. The library is currently at version 3.0.2 and follows semantic versioning after its 1.0 release, with new versions released periodically to add features, fix bugs, and maintain compatibility.
Traffic · last 30 days stale · no recent hits
total hits 10
actors 4 distinct systems
last hit 19d ago ByteDance
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇸🇬 Singapore · 🇩🇪 Germany
Resources
API endpoints
full doc /v1/registry/phantom-types
compatibility /v1/registry/phantom-types/compatibility