AUTHOREA
Log in Sign Up Browse Preprints
LOG IN SIGN UP
Mohammad Mari
Mohammad Mari

Public Documents 1
Type Safety in Python: Existing Frameworks, Challenges and Future Directions
Mohammad Mari
Lian Wen

Mohammad Mari

and 1 more

April 28, 2025
Python's dynamic typing model provides flexibility and rapid development capabilities, but it also introduces significant risks in safety-critical and high-assurance systems where type correctness is essential. This paper examines the current limitations of Python's type system, highlighting challenges related to runtime type errors, the broadness of existing type annotations, and the lack of strong enforcement mechanisms. Although recent advancements, such as gradual typing, offers opportunities for improved static analysis, it remains insufficient to guarantee complete type safety. The paper argues for an enhanced methodology that includes extending the type system through constraint-based types, rigorous validation of dynamically sourced values, and the systematic development of tailored types for critical applications. By integrating stricter static analysis and structured runtime validation practices, Python can be adapted to better meet the demands of high-assurance software development.

| Powered by Authorea.com

  • Home