Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

fix pylint warning for super init not called on mixin class (no init there) #1554

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

s-m-e
Copy link
Contributor

@s-m-e s-m-e commented Jul 22, 2022

I plead guilty ...

Copy link
Member

@astrojuanlu astrojuanlu left a comment

Choose a reason for hiding this comment

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

Rather than "fixing" the warning, this PR ignores the warning. What about actually calling the __init__()? That way we also don't break Python algorithm to traverse the MRO (I think it's called "cooperative multiple inheritance"):

@s-m-e
Copy link
Contributor Author

s-m-e commented Jul 23, 2022

The Orbit class inherits from the OrbitCreationMixin class that is designed as a "mixin", i.e. in this case a class that "only" collects a bunch of class methods. The only reason for the mixin to exist was to break the giant Orbit class into two more manageable parts. That's why it does not have a constructor - why should it? Pylint is not aware of this design pattern and yells at me, hence "fix" ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants