Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant abstractmethod run in setuptools.command.setopt.option_base #4549

Merged

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Aug 8, 2024

Summary of changes

@abravalheri I noticed this abstractmethod was redundant (doesn't break anything) by marking the class as ABC after #4503 was merged

Pull Request Checklist

@abravalheri
Copy link
Contributor

Should we also remove the ABC from the definition class option_base(Command, ABC), as command is now already an ABC? Or is it left there intentionally (to make it more explicit)?

@Avasam
Copy link
Contributor Author

Avasam commented Aug 9, 2024

Should we also remove the ABC from the definition class option_base(Command, ABC), as command is now already an ABC? Or is it left there intentionally (to make it more explicit)?

It's there explicitly.
When subclassing a class with abstract methods, type-checkers will remind you to implement all its abstract methods. Unless you mark it with ABC (or meta=ABCMeta, same thing) where it'll inherit the "Abstract" state of the parent class.

In other words, either option_base adds all 3 abstract methods, or it submetaclasses ABCMeta.

@abravalheri abravalheri merged commit a6f7484 into pypa:main Aug 9, 2024
21 checks passed
@abravalheri
Copy link
Contributor

Thank you!

@Avasam Avasam deleted the setuptools-abstract-base-classes-and-methods branch August 9, 2024 14:05
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