logoalt Hacker News

esprehn • today at 1:36 AM • 1 reply • view on HN

That's also possible in JS with __proto__. The prototypes of the classes in the chain can be mutated at runtime too. How to handle these cases is well understood for JITs though and python could do the same.

See also the warning here:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

And this related article:

https://mathiasbynens.be/notes/prototypes


Replies

mirashii • today at 3:26 AM

The thing that actually makes it harder in Python is threading, because it breaks all ability to reason locally about what might happen and optimize. In Python you have to assume that another thread may do these things at any point mid-execution.

➕ show 1 reply