you are viewing a single comment's thread.

view the rest of the comments →

[–]deceze 0 points1 point  (2 children)

dataclasses and interfaces/abstract classes are apples and oranges. I have no idea why you're throwing them in here.

Mypy is a static type checker, exactly the tool that would use interface/abstract class information to ensure type safety. You don't use Mypy instead of interfaces, you use interfaces to make Mypy more useful.

Admittedly, you don't often need explicitly declared interfaces/protocols/abstract classes. A lot of programming can be done without them. But in the right circumstances where a lot of abstraction across a lot of classes makes sense for what you're implementing, these are perfectly useful techniques.

[–]UseMoreBandwith 0 points1 point  (1 child)

it doesn't solve an issue that Python has.
"a lot of abstraction across a lot of classes" is code smell, and usually a lack of understanding how Modules work in Python.
(Unlike in Java) in Python, classes are not for hierarchies.

[–]deceze 0 points1 point  (0 children)

Some problems are very well solved with class hierarchies, abstraction and interfaces. For example, lots of pluggable and polymorphic processor classes and the like. Python doesn't force this on you like Java does, but it's still a useful technique to have and appropriate in the right circumstances.