Skip to content

Sync intro-to-threading with the updated tutorial - #885

Open
realpython-bot wants to merge 1 commit into
masterfrom
maintenance/intro-to-python-threading-20261014
Open

realpython-bot wants to merge 1 commit into
masterfrom
maintenance/intro-to-python-threading-20261014

Conversation

@realpython-bot

Copy link
Copy Markdown
Collaborator

Syncs intro-to-threading/ with the maintenance update of An Intro to Threading in Python.

Changes

  • single_thread.py: x.start() was commented out and x.join() was active, so the script crashed with RuntimeError: cannot join thread before it is started. Now matches the tutorial's first listing (start the thread, join commented out).
  • fixrace.py: log messages now read Testing update. to match the tutorial, which says the calling code stays the same as in racecond.py and whose output now shows Testing update..
  • prodcom_better_queue.py: consumer() checked the global pipeline.empty() instead of its own queue parameter. Now uses queue.empty(), as in the tutorial.

Links

Verification

  • Ran every script in the folder on Python 3.14.6 (stdlib only, no requirements). All exit cleanly, including single_thread.py, which crashed before.
  • uvx ruff@0.14.1 format --check intro-to-threading and uvx ruff@0.14.1 check intro-to-threading both pass.

🤖 Generated with Claude Code

…reading in Python

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant