py.js / doc / utility.rst

Utility functions for interacting with py.js objects

Essentially the py.js version of the Python C API, these functions are used to implement new py.js types or to interact with existing ones.

They are prefixed with PY_.

Type wrapping javascript functions into py.js callables. The wrapped function follows :ref:`the py.js calling conventions <types-methods-python-call>`

param Function fn:
 the javascript function to wrap
returns:a callable py.js object

Object Protocol

Number Protocol

[1]Python 2, which py.js currently implements, does not support Python-level keyword-only parameters (it can be done through the C-API), but it seemed neat and easy enough so there.
[2]due to this and contrary to Python 2, py.js allows arguments other than **kwargs to follow *args.