Completed
The Example: ElementTree
Class Central Classrooms beta
YouTube videos curated by Class Central.
Classroom Contents
How You Can Benefit from Type Hints
Automatically move to the next video in the Classroom when playback concludes
- 1 Intro
- 2 What This Talk is About
- 3 Quick Poll
- 4 Type Hints Used to Be Informal • An example from the standard library
- 5 PEP 484: Type Hints . Based on function annotations, Python 3.5 - Explicit is better than implicit
- 6 The Main Benefit • Improved readability for both humans and tools • Documentation - More compact and easier to grasp than lengthy native
- 7 The Tools
- 8 The Example: ElementTree
- 9 Exceptions
- 10 Add Type Hints • Start with a few function annotations
- 11 Type Checking
- 12 Let's Annotate ElementTree's API - Most type hints are simple
- 13 Type Inference • Tools can infer types in some cases Follow assignments to variables Return types of local functions
- 14 Code Completion • Context-sensitive code completion
- 15 Docs with Type Hints • From the docstring using the Sphinx autodoc extension
- 16 Type Hints for Your Public APIs
- 17 From Simple to Complex
- 18 Liberal vs Conservative
- 19 Type Hints in Your Code • Type hints in Python 3 function annotations It's enough to pip install a library • Compatible with Python 3.5
- 20 Python Stubs
- 21 Available Type Hints
- 22 Try Type Hints!