Andrew Breza

26%
Flag icon
We can write str | bytes instead of Union[str, bytes] since Python 3.10. It’s less typing, and there’s no need to import Optional or Union from typing. Contrast the old and new syntax for the type hint of the plural parameter of show_count: plural: Optional[str] = None    # before plural: str | None = None       # after
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview