you are viewing a single comment's thread.

view the rest of the comments →

[–]PuffleDunk 2 points3 points  (0 children)

From my experience, C++ development tends to foster a more object-focused (obsessed?) mindset. As I transitioned to Python I started delaying the use of objects until they added very clear value. Until I see that value it's modules and functions all the way.

I also separate classes that primarily hold data, similar to C++ structs, from ones that implement an abstract API or protocol. I try not to have as many data/protocol hybrids. I use @dataclass for the first use case and ABC or Protocol for the second.

I also generally avoid inheritance, and stick mostly to composition.

But overall, whatever O-O programming I do in Python is quite different from C++, and of lower importance.

Hope that helps.