Issue #4 resolved

Better support for class methods

masklinn
repo owner created an issue

There's no built-in support for defining class methods in py.js atm: doing so requires

  • adding a {{{py.def}}} as (javascript) attribute on the {{{py.type}}} object
  • explicitly adding a {{{getattribute}}} attribute to the new type (on the JS side), which will return the {{{py.def}}} defined above

That's verbose and error prone, interface-wise there should be a {{{py.classmethod}}} extending {{{py.def}}} used to mark methods as classmethods, and {{{py.type}}} should define the correct {{{getattribute}}} on the constructor.

Comments (1)

  1. Log in to comment