4 ms·
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 fat
by acjohnson55 13y ago
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.
- amirouche 13y agoIt'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-Cookbook#methods-as-callbacks 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/lib/runtime.py#L114 https://github.com/pythonium/pythonium/blob/master/pythonium...
- acjohnson55 13y agoYeah, that's why I phrased it "wrappers around". Check out https://github.com/lukasolson/Backbone-Super https://github.com/lukasolson/Backbone-Super for example, which wraps and replaces Backbone.extend.
- amirouche 13y agoI never mentionned super. Anyway, thanks for the link.