Skip to content

Revert repo-wide formatter changes outside the article folder - #803

Merged
stephengruppetta merged 1 commit into
realpython:cursor-vs-copilot-pythonfrom
realpython-bot:revert-out-of-scope-formatting
Aug 11, 2026
Merged

Revert repo-wide formatter changes outside the article folder#803
stephengruppetta merged 1 commit into
realpython:cursor-vs-copilot-pythonfrom
realpython-bot:revert-out-of-scope-formatting

Conversation

@realpython-bot

Copy link
Copy Markdown
Contributor

Hi @brianMutea — this targets your cursor-vs-copilot-python branch (PR #802), not master. Merging it here cleans up #802 in place; none of your own work is touched.

What happened

A repo-wide ruff format run picked up 14 files belonging to 13 unrelated tutorials. Easy to hit — the README does say to run the formatter, it just needs scoping to your own folder.

Why it matters

pyproject.toml sets target-version = "py314", so ruff applied PEP 758 and stripped the parentheses from multi-exception except clauses in 9 published sample files:

-except (ZeroDivisionError, ValueError):
+except ZeroDivisionError, ValueError:

That's valid on Python 3.14 but a SyntaxError on 3.13 and earlier — verified on 3.11, 3.12 and 3.13. Those files are downloadable materials for live tutorials, so they'd stop running for most readers. python-multiple-exceptions is the sharpest case: its samples would no longer match what the article teaches.

The CI matrix is Python 3.14 only, so this stays green either way — worth a separate look by the team.

This PR

Reverts all 14 files to master. After merging, PR #802 touches exactly 30 files, all under cursor-vs-copilot-python/.

Verified: all 9 reverted files parse cleanly on Python 3.11.

🤖 Prepared by RPBot on behalf of @stephengruppetta

A repo-wide `ruff format` run reformatted 14 files belonging to 13
unrelated tutorials. Because pyproject.toml sets target-version = "py314",
ruff applied PEP 758 and stripped the parentheses from multi-exception
except clauses in 9 published sample files:

    except (ZeroDivisionError, ValueError):   ->   except ZeroDivisionError, ValueError:

That syntax is valid on Python 3.14 but a SyntaxError on 3.13 and earlier,
so those materials would stop running for most readers - and the CI matrix
is Python 3.14 only, so it stays green either way.

Reverts all 14 files to master. No changes to cursor-vs-copilot-python/.
@stephengruppetta
stephengruppetta merged commit 9f19502 into realpython:cursor-vs-copilot-python Aug 11, 2026
1 check passed
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.

2 participants