Skip to content

Remove ABCMeta metaclass, keep abstractmethods#4580

Merged
jaraco merged 1 commit intopypa:mainfrom
Avasam:no-ABCMeta
Aug 20, 2024
Merged

Remove ABCMeta metaclass, keep abstractmethods#4580
jaraco merged 1 commit intopypa:mainfrom
Avasam:no-ABCMeta

Conversation

@Avasam
Copy link
Contributor

@Avasam Avasam commented Aug 20, 2024

Summary of changes

Closes #4579

#4503 had an unintended consequence of causing potential metaclass subclassing strictess issues. The goal was only to give additional information for static type-checking.

Pull Request Checklist

@Avasam Avasam changed the title Remove ABCMeta metaclass, keep abstractmethods Remove ABCMeta metaclass, keep abstractmethods Aug 20, 2024
Copy link
Member

@jaraco jaraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I to have run into this issue in python/importlib_metadata#422. I ended up adding a mix-in to deprecate implementations that weren't implementing the abstract methods in order to slowly introduce the proper base classes. You might want to consider a similar approach for these classes (assuming you still wish to pursue the declarations).

@jaraco jaraco merged commit 18963fb into pypa:main Aug 20, 2024
@Avasam Avasam deleted the no-ABCMeta branch August 20, 2024 18:18
@Avasam
Copy link
Contributor Author

Avasam commented Aug 20, 2024

I to have run into this issue in python/importlib_metadata#422. I ended up adding a mix-in to deprecate implementations that weren't implementing the abstract methods in order to slowly introduce the proper base classes. You might want to consider a similar approach for these classes (assuming you still wish to pursue the declarations).

Thanks for the tip! For me the value was really just in declaring the abstract methods so checkers could know they exist.

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.

[BUG] setuptools version 73.0.0 breaks Pythran

2 participants