Summary
Python 3.14 is scheduled for release on October 7, 2025. We should upgrade policyengine.py to support Python 3.14 and take advantage of its performance improvements and new features.
Key Benefits for policyengine.py
Performance Improvements
- 3-5% geometric mean performance improvement - faster programmatic calculations
- Up to 30% faster for certain workloads with newer compilers
- Incremental garbage collection with reduced pause times
- Better performance for batch analyses and scripting
Free-Threaded Python (No GIL)
- Free-threaded mode is now officially supported
- Users can enable true parallel computation for batch household calculations
- Better performance for data science workflows (Jupyter notebooks, scripts)
- Performance penalty in single-threaded mode reduced to just 5-10%
Type System & Numerical Improvements
- Deferred evaluation of type annotations reduces import overhead
- New
float.from_number() and complex.from_number() methods
- Enhanced mixed-mode arithmetic
- Better type hint performance for IDE support
Concurrency Features
InterpreterPoolExecutor for parallel policy calculations
- Multiple interpreters in standard library
- Improved context variable and threading support
Other Improvements
- Native Zstandard compression for faster data I/O
- Improved error messages for better debugging experience
- Simpler exception handling syntax (PEP 758)
- Better integration with data science ecosystem
Implementation Plan
- Wait for policyengine-api upgrade - Ensure API supports Python 3.14 first
- Update
pyproject.toml to include Python 3.14 in supported versions
- Add Python 3.14 to CI/CD test matrix
- Test all functionality with Python 3.14
- Update documentation with Python 3.14 examples
- Consider adding examples using free-threaded mode for parallel calculations
Priority
Medium - Should coordinate with API upgrade (depends on policyengine-api upgrade). The performance improvements will benefit users running batch analyses and simulations.
Related Issues
References
Summary
Python 3.14 is scheduled for release on October 7, 2025. We should upgrade policyengine.py to support Python 3.14 and take advantage of its performance improvements and new features.
Key Benefits for policyengine.py
Performance Improvements
Free-Threaded Python (No GIL)
Type System & Numerical Improvements
float.from_number()andcomplex.from_number()methodsConcurrency Features
InterpreterPoolExecutorfor parallel policy calculationsOther Improvements
Implementation Plan
pyproject.tomlto include Python 3.14 in supported versionsPriority
Medium - Should coordinate with API upgrade (depends on policyengine-api upgrade). The performance improvements will benefit users running batch analyses and simulations.
Related Issues
References