Python 3.15: features that didn't make the headlines
2 hours ago
- #threading
- #asyncio
- #Python 3.15
- Python 3.15 introduces graceful cancellation for asyncio TaskGroups with TaskGroup.cancel(), simplifying structured concurrency.
- Context managers can now properly decorate async functions and generators via ContextDecorator in Python 3.15, covering their entire lifecycle.
- Thread-safe iterators are added with threading.serialize_iterator and threading.concurrent_tee to enable safe multi-threaded iteration without abstraction changes.
- The Counter class in collections now supports xor (^) operation for completeness in set-like discrete object handling.
- Immutable JSON parsing is enhanced with array_hook in json.loads, allowing conversion to tuples and frozendict for hashable representations.