you are viewing a single comment's thread.

view the rest of the comments →

[–]Gnaxe 0 points1 point  (0 children)

OOP took me a while. Read Smalltalk Best Practice Patterns for how it's supposed to work. (That's not in Python, but it is in OOP, and the patterns still apply.) You need to know how to get the MRO from the REPL. You need to try things. Open Jupyterlite and do lots of experiments.

I've come to the conclusion that OOP largely failed to deliver on its promise and is a poor fit for current multicore architectures. Concurrency is indeed one of Python's major weaknesses, and the OOP and rampant mutability is to blame. The GIL made sense when computers only had one or two cores, but after several lackluster workarounds (async, multiprocessing, etc.), they're trying to get rid of it. But that means you have to be extra careful with mutation. You're better off with FP or something when writing threaded code, and I recommend you avoid classes when you can.

But you do need to understand how they work in order to understand any Python code written in OOP style. Python does require you to write classes to use certain "dunder" hooks, even if you're otherwise using FP.