MCPcopy Index your code
hub / github.com/pyscript/pyscript / __getitem__

Method __getitem__

core/src/stdlib/pyscript/workers.py:100–112  ·  view source on GitHub ↗

Get a named worker by `name`. It returns a promise that resolves to the worker reference when ready. This is useful if the underlying worker name is not a valid Python identifier. ```python worker = await workers["my-worker"] ```

(self, name)

Source from the content-addressed store, hash-verified

98 """
99
100 def __getitem__(self, name):
101 """
102 Get a named worker by `name`. It returns a promise that resolves to
103 the worker reference when ready.
104
105 This is useful if the underlying worker name is not a valid Python
106 identifier.
107
108 ```python
109 worker = await workers["my-worker"]
110 ```
111 """
112 return js.Reflect.get(_polyscript_workers, name)
113
114 def __getattr__(self, name):
115 """

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected