Having recently started a script that avoided OO because I wrongly assumed that its was going to be 4 functions and done, I disagree.
I don't care about inheritance, that's just a way for someone to trip you up and make them feel smug about being "elegant"
I don't care for people trying to hide stuff with self._hiddenThing. Its python, nothing is hidden. If I want to reach in and grab your class by the ankles, prepending a "_" isn't going to stop me.
I agree wholeheartedly with dataclasses. I just wish that type annotations were actually enforced at run time. At the moment they are only really useful if you have pyre turned up to 11 (bye bye productivity) or have an IDE that understands type hints.
but, the hill I will die on is this: storing class state in self.blah. It is correct and proper to do that in a class, it limits the amount of args I have to shove into a function/method, it also allows me to pull out and check things before I do them. Yes they can be abused. Yes it means that you need to call functions in order. Yes it means you have to be more defensive about missing state.
But you need to be careful about that anyway. with minimal OO you can avoid a lot of typing and nasty verbose function args in python.
I don't care about inheritance, that's just a way for someone to trip you up and make them feel smug about being "elegant"
I don't care for people trying to hide stuff with self._hiddenThing. Its python, nothing is hidden. If I want to reach in and grab your class by the ankles, prepending a "_" isn't going to stop me.
I agree wholeheartedly with dataclasses. I just wish that type annotations were actually enforced at run time. At the moment they are only really useful if you have pyre turned up to 11 (bye bye productivity) or have an IDE that understands type hints.
but, the hill I will die on is this: storing class state in self.blah. It is correct and proper to do that in a class, it limits the amount of args I have to shove into a function/method, it also allows me to pull out and check things before I do them. Yes they can be abused. Yes it means that you need to call functions in order. Yes it means you have to be more defensive about missing state.
But you need to be careful about that anyway. with minimal OO you can avoid a lot of typing and nasty verbose function args in python.