This is correct. Don't write a class if the class is only 2 methods & one is an init. That should just be a function. I was watching this with extreme skepticism because I usually see too few classes in python code.
https://www.youtube.com/watch?v=5ZKvwuZSiyc&t=19s
This guy admits, if you got multiple functions with all the same first argument, it should have been a class.
♡ 2 ↻ 0And this guy is highly skeptical of code that is a stub, eg.
class MyBase(object):
pass
class MyException(Exception):
pass
I disagree about custom exceptions. It is not my fault that exception filtering calls for writing an empty class, that is the fault of the runtime.♡ 0 ↻ 0