Python's New Type Hints in Action… In JavaScript
summary
Claims that PEP 484 brings optional static typing to Python and that Python can learn from TypeScript’s experience. Demonstrations use the TypeScript compiler compiling away types, the typing module plus a type checker in Python 3.5, community stubs like DefinitelyTyped, and separate signature files (pyi stubs). Type inference and any enable gradual typing; TypeScript ships since 2012 (1.0) and thousands watched a keynote, and the approach compiles and interoperates without breaking existing code.
AI-written summary · about
chapters (11)
- 0:00Intro
- 1:492008 Python 3 introduces function annotations
- 3:072015: PEP 484 Type Hints
- 3:52The Python feature addition process Stage 1: PEP is proposed and discussed • Stage 2: PEP is adopted Stage 3: Feature is added to the next Python release
- 8:50Consume a type-checked API get free type checking on your own code
- 9:33If the only thing you do is consume a typescript API, there's still benefit to type checking.
- 13:22Type constraints can be broken if you're confident they need to be.
- 15:13Third Party Interfaces
- 20:17Verifiable parameter/return type documentation Like doctests, but formal!
- 24:39Make type hints that are useful to your own context.
- 25:04Conclusion It's not the end of the world You don't have to if you don't want to There are benefits








