This PR changes the type annotation of _add_ws from bool to TagAttrValue. Even though the value must still actually be a bool, this change simplifies writing functions that pass along kwargs.
For example, previously pyright would flag this as an error, because the kwargs could include _add_ws, but the former is a TagAttrValue while the latter is a bool:
After this PR, the first version of the code is not flagged as an error by the type checker. If a non-bool is passed to _add_ws, there will be a run-time error.
This PR changes the type annotation of
_add_ws
frombool
toTagAttrValue
. Even though the value must still actually be abool
, this change simplifies writing functions that pass alongkwargs
.For example, previously pyright would flag this as an error, because the
kwargs
could include_add_ws
, but the former is aTagAttrValue
while the latter is abool
:In order to satisfy the type checker, you previously would have to write this:
After this PR, the first version of the code is not flagged as an error by the type checker. If a non-bool is passed to
_add_ws
, there will be a run-time error.