Repository navigation
Documentation
- The threads section of the concurrency guide was wrong for free-threaded Python 3.14.
There, a new thread starts in a copy of the context that started it, so its sections
nest under the section that was open at that moment. A thread pool reuses its workers,
so each worker keeps the section it started under: work submitted later from another
section was reported under the first one. The guide said pool work is always reported at
the top level, and that free-threaded builds nest thread work correctly with no extra
work. Neither was true on every build. The guide now explains the difference and shows
how to get the same report on every build: run each call in
contextvars.copy_context().runto nest it under the current section, or in
contextvars.Context().runto keep it at the top level. Behaviour is unchanged. - Tests cover how threads and reused pool workers nest on each kind of build, and both
recipes. The guide's examples assert their results on every build.
Full changelog: v1.1.0...v1.1.1