Massive automated renaming of all Py_/PyObject/etc. prefixes to Ty_/TyObject/etc.
This includes:
- All public API types (TyObject, TyTypeObject, etc.)
- All public API functions (Ty_Initialize, Ty_BuildValue, etc.)
- All internal API (_Ty_ prefixes)
- Reference counting macros (Ty_INCREF, Ty_DECREF, etc.)
- Type flags (Ty_TPFLAGS_*)
- Debug flags (Ty_DEBUG, Ty_TRACE_REFS, etc.)
- All object type APIs (TyList_, TyDict_, TyUnicode_, etc.)
This changes over 60,000 occurrences across 1000+ files.
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Added type annotations to strict_types decorator (func: F -> F)
- Added type annotations to _check_type parameters (value: Any, expected_type: Type)
- Removed unused get_type_hints import
- Added TypeVar and proper typing imports for decorator
- All functions now have complete type annotations including helpers
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Added @strict_types decorator that validates all parameters have type hints
- Functions without type annotations now raise TypeError at definition time
- All functions in the module decorated with @strict_types
- def my_func(var1, var2): raises TypeError (no annotations)
- def my_func(var1: str, var2: int): is accepted (has annotations)
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Use getattr to safely access __name__ attribute for better type error messages
- Remove redundant type checks for sys.argv elements (guaranteed to be strings)
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Added complete type annotations to all functions, parameters, and return types
- Added runtime type checking function _check_type() that enforces strict typing
- All functions now validate parameter types and raise TypeError if incorrect
- Added comprehensive docstrings explaining type requirements
- Module header variable now has explicit type annotation
- Tested both normal operation and type error detection
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>