Post #2261671
2026-03-08 00:36 UTC
And these simplifications to type hints:
- typing simplifications
- List, Dict, Tuple, etc. -> list, dict, and tuple (3.9)
- Union[X, Y] and Optional[X] -> X|Y and X|None (3.10)
- no more class Z(Generic[T]), just class Z[T] (3.12)
- also def last[T](seq: Sequence[T]) -> T (3.12)
- 'type' as a statement (3.12)
Replies (1)
-
@tartley@fosstodon.org 2026-03-08 00:57
@ptmcg@fosstodon.org I feel compelled to contribute! - asyncio.TaskGroup was added to the stdlib in 3.11, being a wholly different (and strictly better!) way of doing async, making it much easier to understand & reason about, and unlike regular async code, able to reliably catch errors, etc. These features are the stdlib's improved version of Trio's nurseries, as justified in a seminal and mind-blowing article: Notes on Structured Concurrency https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/