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

Inheritance... #1406

Closed
alanlujan91 opened this issue Apr 6, 2024 · 4 comments · Fixed by #1407
Closed

Inheritance... #1406

alanlujan91 opened this issue Apr 6, 2024 · 4 comments · Fixed by #1407

Comments

@alanlujan91
Copy link
Member

class KinkedRconsumerType(IndShockConsumerType):

KinkedR inherits from IndShockConsumerType

PerfForesightConsumerType.__init__(self, **params)

But init's from PerfForesightConsumerType

is this a bug? does it make a difference?

@mnwhite
Copy link
Contributor

mnwhite commented Apr 6, 2024 via email

@alanlujan91
Copy link
Member Author

I guess my question is why type the class name at all instead of super().__init__(**params) or for other methods across the codebase typing parent_class_name.method(self) instead of super().method(). It's not like we're doing a lot of double inheritance, and it would prevent these errors from happening since it always knows the right parent.

@mnwhite
Copy link
Contributor

mnwhite commented Apr 6, 2024 via email

@alanlujan91
Copy link
Member Author

please see PR #1407

replaced references to parent class with super
also removed some redundant calls to construction

there is one check failing which is concerning me, because I don't think I changed anything substantive, which makes me think there might have been a bug due to the spaghetti inheritance

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 a pull request may close this issue.

2 participants