Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/python-wasm
Path: blob/main/python/pylang/src/lib/js.py
1398 views
1
# Code that is NOT written in valid Python syntax, but can
2
# be used from valid python code to accomplish various things
3
# that are needed.
4
5
# This gives us the new operator as a Python function call:
6
def js_new(f, *args, **kwds):
7
return new f(*args, **kwds)
8
9
def js_instanceof(obj, cls):
10
return r"%js obj instanceof cls"
11