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 ↓12% vs prev 7d
total hits 20
actors 9 distinct systems
last hit 2d ago ByteDance
top countries 🇺🇸 United States · 🇫🇷 France · 🇨🇦 Canada · 🇩🇪 Germany · 🇸🇬 Singapore
Resources
API endpoints
full doc /v1/registry/phantom-types
compatibility /v1/registry/phantom-types/compatibility