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

Method __getattr__

core/src/stdlib/pyscript/web.py:524–534  ·  view source on GitHub ↗

Get an attribute from the element. Attributes starting with `on_` return `Event` instances. Other attributes are retrieved from the underlying DOM element.

(self, name)

Source from the content-addressed store, hash-verified

522 )
523
524 def __getattr__(self, name):
525 """
526 Get an attribute from the element.
527
528 Attributes starting with `on_` return `Event` instances. Other
529 attributes are retrieved from the underlying DOM element.
530 """
531 if name.startswith("on_"):
532 return self.get_event(name)
533 dom_name = self._normalize_attribute_name(name)
534 return getattr(self._dom_element, dom_name)
535
536 def __setattr__(self, name, value):
537 """

Callers

nothing calls this directly

Calls 2

get_eventMethod · 0.95

Tested by

no test coverage detected