Repository navigation
Sync new materials folders with article bug fixes - #896
Merged
Merged
Conversation
Keeps the code in sync with fixes applied to the update drafts: - operator-function-overloading: CustomComplex uses self.__class__, returns NotImplemented for unsupported operands, uses atan2 in argz() - python-data-classes: make_dataclass field order matches the class - documenting-python-code: spreadsheet script reads CSV as documented, keeps its usage message formatting, typo fixes - python-sql-libraries: single-quoted SQL literals, catch psycopg2.Error in the PostgreSQL helpers, comma between foreign keys Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
martin-martin
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #895, which was merged before this commit reached it.
While building the folders in #895, the tutorials' own code turned out to have bugs. Those were fixed in the update drafts, and this PR brings the materials code in line with the fixed articles:
operator-function-overloading/custom_complex.py: the solution usesself.__class__(matching the tutorial's snippets), returnsNotImplementedfor unsupported operands instead of failing withUnboundLocalError, usesatan2()inargz()(noZeroDivisionErrorfor a zero real part, correct quadrant for a negative one), and__eq__/__ne__handle unrelated types; docstring typos fixed.python-data-classes/position_make_dataclass.py:make_dataclass()field order now matches the class it's meant to be equivalent to (name, lon, lat).documenting-python-code/: the spreadsheet script now reads.csvfiles as its docstring promises, keeps its docstring's formatting in the-husage message, and namesopenpyxl/xlrd; typo fixes.python-sql-libraries/: single-quoted SQL string literals (the PostgreSQL update crashed with double quotes), the PostgreSQL helpers catchpsycopg2.Errorso a rerun doesn't crash onDuplicateDatabase, and the missing comma between theFOREIGN KEYclauses.Verified on Python 3.14 (SQL scripts against SQLite, MariaDB 10.11, and PostgreSQL 16); ruff 0.14.1 format/check and dircheck pass.
🤖 Generated with Claude Code