INNER CODE UNIT · Python
XBool
volfpeter/htmy · htmy/core.py:196
class XBool(enum.Enum):
"""
Utility for the valid formatting of boolean XML (and HTML) attributes.
See this article for more information:
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes#boolean_attributes
"""
true = True
false = False
def format(self) -> str:
"""
Raises `SkipProperty` for `XBool.false`, returns empty string for `XBool.true`.
"""
if self is XBool.true:
return ""