Skip to content

Replace ty: ignore with proper type declarations for inheritance patterns - #3034

Merged
gaborbernat merged 1 commit into
pypa:mainfrom
rahuldevikar:users/rahuldevikar/fix-ty-inheritance
Feb 15, 2026
Merged

Replace ty: ignore with proper type declarations for inheritance patterns#3034
gaborbernat merged 1 commit into
pypa:mainfrom
rahuldevikar:users/rahuldevikar/fix-ty-inheritance

Conversation

@rahuldevikar

@rahuldevikar rahuldevikar commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

Several base classes used attributes that are only defined in subclasses (via mixins). ty couldn't see those attributes from the base class perspective, so we had ty: ignore[unresolved-attribute] and ty: ignore[not-iterable] comments.

Type checkers analyze each class in isolation. When Describe provides exe but Creator accesses self.exe, the checker doesn't see the connection because they're only combined at the concrete class level. Our fix was to add property stubs in the base class

Extension work of: #3029

Thanks for contributing, make sure you address all the checklists (for details on how see development documentation)

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

@rahuldevikar
rahuldevikar force-pushed the users/rahuldevikar/fix-ty-inheritance branch from 8362bf3 to 8ca4c43 Compare February 14, 2026 23:01
@rahuldevikar
rahuldevikar marked this pull request as ready for review February 14, 2026 23:25
@gaborbernat
gaborbernat merged commit 6e80d06 into pypa:main Feb 15, 2026
51 checks passed
This was referenced Mar 12, 2026
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