PythonMonkey   v0.3.1 (dev)
Loading...
Searching...
No Matches
pythonmonkey.pythonmonkey Namespace Reference

Classes

class  bigint
 
class  EvalOptions
 
class  JSObjectProxy
 
class  SpiderMonkeyError
 

Functions

_typing.Any eval (str code, EvalOptions evalOpts={})
 
_typing.Awaitable[None] wait ()
 
bool isCompilableUnit (str code)
 
JSObjectProxy internalBinding (str namespace)
 
None collect ()
 

Variables

 null
 

Detailed Description

stub file for type hints & documentations for the native module
@see https://typing.readthedocs.io/en/latest/source/stubs.html

Function Documentation

◆ collect()

None pythonmonkey.pythonmonkey.collect ( )
Calls the spidermonkey garbage collector

◆ eval()

_typing.Any pythonmonkey.pythonmonkey.eval ( str  code,
EvalOptions   evalOpts = {} 
)
JavaScript evaluator in Python

◆ internalBinding()

JSObjectProxy pythonmonkey.pythonmonkey.internalBinding ( str  namespace)
INTERNAL USE ONLY

See function declarations in ./builtin_modules/internal-binding.d.ts

◆ isCompilableUnit()

bool pythonmonkey.pythonmonkey.isCompilableUnit ( str  code)
Hint if a string might be compilable Javascript without actual evaluation

◆ wait()

_typing.Awaitable[None] pythonmonkey.pythonmonkey.wait ( )
Block until all asynchronous jobs (Promise/setTimeout/etc.) finish.

```py
await pm.wait()
```

This is the event-loop shield that protects the loop from being prematurely terminated.

Variable Documentation

◆ null

pythonmonkey.pythonmonkey.null
Initial value:
1= _typing.Annotated[
2 _typing.NewType("pythonmonkey.null", object),
3 "Representing the JS null type in Python using a singleton object",
4]