beeware / batavia

A JavaScript implementation of the Python virtual machine.
http://pybee.org/batavia
Other
1.39k stars 424 forks source link

Difficulties implementing classmethod #701

Open lielfr opened 6 years ago

lielfr commented 6 years ago

So, the classmethod builtin is actually a decorator which is meant to allow functions access to the class definition. In order to implement this in Batavia, we need to actually get the parent of the function, which cannot be done in "pure" javascript because a function can have multiple parents. Does anyone have suggestions on how it should be implemented?