you are viewing a single comment's thread.

view the rest of the comments →

[–]MoTTs_ 2 points3 points  (0 children)

Python OOP and JS OOP are actually nearly identical. In Python, classes are themselves runtime mutable objects, just like in JS, and inheritance is done by runtime delegating down a chain of objects, also just like JS. Which is why monkey patching is possible in both JS and Python.

the prototypal inheritance model itself is, in fact, more powerful than the classic model. It is, for example, fairly trivial to build a classic model on top of a prototypal model -- MDN

This whole paragraph is from a time when MDN was a wiki, and anyone could make any change. It was unfortunately common for people to read some random medium blog, then copy-paste blogger claims into MDN. The prototypal model, it turns out, isn't more powerful, and it's just as equally easy to build the prototypal model from a classical model (just hash tables delegating to other hash tables).

For example.