You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MAINT: Remove hasattr/getattr anti-patterns by initializing attributes to None #9880
The biggest challenge with statsmodels is there are too many attributes that are totally missing when not used. These should all be replaced with code like self.attr = None and then if something: self.attr = value. Statsmodels has a lot of code that uses hasattr and getattr(...,... default). Both of these are anti pattern imo.
I'm planning to work on this, so created a separate issue.
Actually, i was looking for the discussion of adding type hints in statsmodels, but haven't got clear decision in issue as i think there are some difficulties. I'd be happy to discuss if there are plans to add. Thanks!
I'm happy to see this implemented. Rather than None, perhaps we should use
a sentence value, something like numpy or pandas (I think the use _NoValue
which has a special connotation different from None).
Happy to help chip away at this. I see #10024 is handling the OLS attributes with the _NoValue sentinel pattern, is there a specific module or set of classes still unclaimed that I could take on using the same approach? Also happy to defer to @Aniketsy if you're already covering this broadly
Happy to help chip away at this. I see #10024 is handling the OLS attributes with the _NoValue sentinel pattern, is there a specific module or set of classes still unclaimed that I could take on using the same approach? Also happy to defer to @Aniketsy if you're already covering this broadly
Actually i did some work on this, back then when opened an issue, but stuck somewhere, so i'm planning to give this fresh start soon.
Going to wait until after 0.15 is out, which should be later this month.
oh that's good news, i guess there are soo many things fixed and improved in this release.
Activity
bashtage commentedon Jul 1, 2026
Mustaphayinka commentedon Aug 23, 2026
Happy to help chip away at this. I see #10024 is handling the OLS attributes with the _NoValue sentinel pattern, is there a specific module or set of classes still unclaimed that I could take on using the same approach? Also happy to defer to @Aniketsy if you're already covering this broadly
bashtage commentedon Aug 23, 2026
Going to wait until after 0.15 is out, which should be later this month.
Aniketsy commentedon Aug 23, 2026
Actually i did some work on this, back then when opened an issue, but stuck somewhere, so i'm planning to give this fresh start soon.
oh that's good news, i guess there are soo many things fixed and improved in this release.