Type checking
Invalid markup is a type error
Elements and components declare the children and attributes they accept. The mypy plugin checks every call, so mistakes show up in your editor and in CI instead of in the browser.
br("Hello, World!") html(body()) div("Test", href="test") Link("here", too="/home") Link(div("here"), to="/home") Link("here")
app.py:1: error: Argument 1 to "br" has incompatible type "str"; expected "Never" app.py:2: error: Argument 1 to "html" has incompatible type "body"; expected "head" app.py:3: error: Unexpected keyword argument "href" for "div" app.py:4: error: Unexpected keyword argument "too" for "Link"; did you mean "to"? app.py:5: error: Argument 1 to "Link" has incompatible type "div"; expected "str" app.py:6: error: Missing named argument "to" for "Link" Found 6 errors in 1 file (checked 1 source file)
