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

Class NotSupported

core/src/stdlib/pyscript/util.py:32–52  ·  view source on GitHub ↗

Small helper that raises exceptions if you try to get/set any attribute on it.

Source from the content-addressed store, hash-verified

30
31
32class NotSupported:
33 """
34 Small helper that raises exceptions if you try to get/set any attribute on
35 it.
36 """
37
38 def __init__(self, name, error):
39 object.__setattr__(self, "name", name)
40 object.__setattr__(self, "error", error)
41
42 def __repr__(self):
43 return f"<NotSupported {self.name} [{self.error}]>"
44
45 def __getattr__(self, attr):
46 raise AttributeError(self.error)
47
48 def __setattr__(self, attr, value):
49 raise AttributeError(self.error)
50
51 def __call__(self, *args):
52 raise TypeError(self.error)
53
54
55def is_awaitable(obj):

Callers 1

context.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected