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

Method __getattr__

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

Get a named worker as an attribute. It returns a promise that resolves to the worker reference when ready. This allows accessing workers via dot notation as an alternative to bracket notation. ```python worker = await workers.my_worker ```

(self, name)

Source from the content-addressed store, hash-verified

112 return js.Reflect.get(_polyscript_workers, name)
113
114 def __getattr__(self, name):
115 """
116 Get a named worker as an attribute. It returns a promise that resolves
117 to the worker reference when ready.
118
119 This allows accessing workers via dot notation as an alternative
120 to bracket notation.
121
122 ```python
123 worker = await workers.my_worker
124 ```
125 """
126 return js.Reflect.get(_polyscript_workers, name)
127
128
129# Global workers proxy for accessing named workers.

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected