Hacker News new | past | comments | ask | show | jobs | submit login

I hope your object model doesn't require understanding the MRO to trace the code, unless you're doing some serious library plumbing that I can't even really fathom using in front-end code right now. But I'm fairly certain you could mimic those semantics with wrappers around prototypal inheritance somehow.



It's not possible to use prototypal inheritance to mock even simple inheritance since “method = object.metod; method();” loose the reference to “this” as “object”, it's a gotcha in the lower level mode Veloce of Pythonium that I tried to explain in https://github.com/pythonium/pythonium/wiki/Pythonium-Veloce.... The MRO and thus multiple inhertiance is implemented in pythonium_create_class https://github.com/pythonium/pythonium/blob/master/pythonium...


Yeah, that's why I phrased it "wrappers around". Check out https://github.com/lukasolson/Backbone-Super for example, which wraps and replaces Backbone.extend.


I never mentionned super. Anyway, thanks for the link.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: