Conversation
Python 3.10 is the minimum since SAP#306, so the two-argument form of super() that Python 2 needed is noise in every subclass initializer. Replace all 41 occurrences in exceptions.py, v2/model.py, v2/service.py and vendor/SAP.py with the zero-argument form. Each replacement was checked against the enclosing class: the name passed to super() was the class being defined in every case, so no call was deliberately skipping a level of the MRO and behaviour is unchanged. The one continuation line that no longer lined up with its opening parenthesis was re-indented. No test is added because no behaviour changes; the existing suite covers every touched initializer. Part of SAP#302. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
isinstance() accepts a union type since Python 3.10, which is now the minimum, so the tuple form at the two places SAP#302 names is replaced with `tuple | list` and `model.EntityType | model.Collection`. No behaviour changes; the existing tests cover both branches. Part of SAP#302. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Part of #302: the two mechanical items from the checklist, now that Python 3.10 is the minimum since #306.
What changes
super(ClassName, self)→super()at all 41 occurrences inexceptions.py,v2/model.py,v2/service.pyandvendor/SAP.py(the issue estimates 46; 41 is what the tree holds today).isinstance(x, (A, B))checks named in the issue (service.py,_build_expressionvalue handling andfunction_import_handlerreturn type) becomeisinstance(x, A | B).Two commits, one per logical change, as CONTRIBUTING asks. The
match/caserefactors from the same checklist are deliberately left for separate pull requests: they touch control flow and deserve their own review.Why no new test
No behaviour changes. Every
super()replacement was checked against its enclosing class with an AST pass: in every case the class named in the call was the class being defined, so no call was skipping a level of the MRO. The existing suite covers every touched initializer and bothisinstancebranches.Checked locally with the pinned tool versions, on Python 3.10.20
flake8 --config=.flake8 pyodata: cleanpylint --rcfile=.pylintrc pyodata: 10.00/10pytest: 295 passed (also 295 on Python 3.14.5)bandit -lll -r pyodata: no findings🤖 Generated with Claude Code