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

Method _normalize_attribute_name

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

Normalize Python attribute names to DOM attribute names. Removes trailing underscores and maps special cases.

(self, name)

Source from the content-addressed store, hash-verified

552 setattr(self._dom_element, dom_name, value)
553
554 def _normalize_attribute_name(self, name):
555 """
556 Normalize Python attribute names to DOM attribute names.
557
558 Removes trailing underscores and maps special cases.
559 """
560 if name.endswith("_"):
561 name = name[:-1]
562 if name == "for":
563 return "htmlFor"
564 if name == "class":
565 return "className"
566 return name
567
568 def get_event(self, name):
569 """

Callers 2

__getattr__Method · 0.95
__setattr__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected