I've just saw Jack Diederich's "Stop Writing Classes" talk (2012) for the first time (https://www.youtube.com/watch?v=o9pEzgHorH0). This talk has shown up on HN a few times, but only elicited a big conversation in one thread back in 2012 (https://news.ycombinator.com/item?id=3717715).
One of the main takes is "Don't write classes that could just be a function" (stated in the video as "If a class has two methods and one of them is __init__, it doesn't need to be a class"). But given the addition of dataclasses and typing to python in the last 10 years, is this still good advice for code style?
For a more specific example, I'd prefer to defining a "useless" class for the purpose of typing like this:
@dataclass
class FooFuncParams:
bar: str
baz: int
...
def foofunc(params: FooFuncParams):
...
Rather than having to use overly-permissive typing like this:
def foofunc(params: Dict[str, Any]):
...
What the talk is discussing is the creation of classes for wrapping related _functionality_, sans state. The class isn't really necessary at that point, so you should just create a module with functions instead of a class.
Even if you do need your related functionality to reference some common state, you still might not need a class, because modules themselves are objects and can hold state.
The point of the talk is not to dissuade you from _ever_ using classes, it's to make you think more judiciouly about adding new classes you probably don't need. Python isn't Java, and you dont need everything to be a class.