MCPcopy
hub / github.com/pyodide/pyodide / toString

Method toString

src/core/pyproxy.ts:722–736  ·  view source on GitHub ↗

* Returns `str(o)` (unless `pyproxyToStringRepr: true` was passed to * :js:func:`~exports.loadPyodide` in which case it will return `repr(o)`)

()

Source from the content-addressed store, hash-verified

720 * :js:func:`~exports.loadPyodide` in which case it will return `repr(o)`)
721 */
722 toString(): string {
723 let ptrobj = _getPtr(this);
724 let result;
725 try {
726 Py_ENTER();
727 result = __pyproxy_repr(ptrobj);
728 Py_EXIT();
729 } catch (e) {
730 API.fatal_error(e);
731 }
732 if (result === Module.error) {
733 _pythonexc2js();
734 }
735 return result;
736 }
737 /**
738 * Destroy the :js:class:`~pyodide.ffi.PyProxy`. This will release the memory. Any further attempt
739 * to use the object will raise an error.

Callers 15

smoke-test.jsFile · 0.80
toDefinesFunction · 0.80
scheduler.tsFile · 0.80
browser_resolvePathFunction · 0.80
calculateInstallBaseUrlFunction · 0.80
decodeBuildIdFunction · 0.80
readMethod · 0.80
error_handling.tsFile · 0.80
generateDestroyedMessageFunction · 0.80
defaultCompareFuncFunction · 0.80
ownKeysFunction · 0.80

Calls 1

_getPtrFunction · 0.85

Tested by

no test coverage detected