MCPcopy
hub / github.com/pyodide/pyodide / set

Method set

src/core/pyproxy.ts:1026–1039  ·  view source on GitHub ↗

* This translates to the Python code ``obj[key] = value``. * * @param key The key to set. * @param value The value to set it to.

(key: any, value: any)

Source from the content-addressed store, hash-verified

1024 * @param value The value to set it to.
1025 */
1026 set(key: any, value: any) {
1027 let ptrobj = _getPtr(this);
1028 let err;
1029 try {
1030 Py_ENTER();
1031 err = __pyproxy_setitem(ptrobj, key, value);
1032 Py_EXIT();
1033 } catch (e) {
1034 API.fatal_error(e);
1035 }
1036 if (err === -1) {
1037 _pythonexc2js();
1038 }
1039 }
1040 /**
1041 * This translates to the Python code ``del obj[key]``.
1042 *

Callers 15

pytest_terminal_summaryFunction · 0.80
initializeNativeFSFunction · 0.80
getFsHandlesFunction · 0.80
snapshot.tsFile · 0.80
initializePackageIndexFunction · 0.80
addPackageToLoadMethod · 0.80
recursiveDependenciesMethod · 0.80
downloadAndInstallMethod · 0.80
readMethod · 0.80
installer.test.tsFile · 0.80
literal-map.jsFile · 0.80
drainBufferFunction · 0.80

Calls 1

_getPtrFunction · 0.85

Tested by 4

pytest_terminal_summaryFunction · 0.64
test_create_task_contextFunction · 0.64
runFunction · 0.64
_serveFunction · 0.64