Repository navigation
Conversation
ITKClass.__eq__ omitted has_superclass, so two class descriptions that differ only in that field compared equal. The pyi stub generator uses this equality to decide whether a cached pickle needs to be rewritten, so a has_superclass-only change would leave a stale pickle in place. Affects both copies of ITKClass (igenerator.py, pyi_generator.py).
Member
|
@greptileai review this draft before I make it official |
Contributor
[Medium impact] The PR appears safe to merge.
|
hjmjohnson
approved these changes
Oct 19, 2026
hjmjohnson
left a comment
Member
There was a problem hiding this comment.
This looks correct. Thank you for tracking this down.
hjmjohnson
marked this pull request as ready for review
October 19, 2026 12:49
dzenanz
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.
Fix
ITKClass.__eq__to comparehas_superclass, so stub-generation caching does not treat two classes that differ only in that field as equal.Root cause
ITKClass.__init__defines 10 fields, but__eq__(duplicated in bothWrapping/Generators/SwigInterface/igenerator.pyandWrapping/Generators/Python/itk/pyi_generator.py) compared only 9,omitting
has_superclass.igenerator.pyuses this equality to decidewhether to overwrite a cached
.pklfile used for Python stubgeneration, so a
has_superclass-only change would leave a stalepickle on disk.
AI assistance
ITKClassdefinitions, comparing
__init__'s field list against__eq__and the equivalent manual comparison in
pyi_generator.py'smerge().ITKClassfrompyi_generator.pyandconfirmed two instances differing only in
has_superclasscompared equal before the fix, unequal after.