For TagChildArg, the Iterable["TagChildArg"] is too permissive, because it allows sets and dicts. For example, the type checker doesn't flag these, but these result in run-time errors:
div({"a", "b"})
#> TypeError: Invalid tag child type: <class 'set'>. Consider calling str() on this value be fore treating it as a tag child.
div({"a": "a"})
#> TypeError: Invalid tag child type: <class 'dict'>. Consider calling str() on this value b efore treating it as a tag child.
One note: the reason I used Dict and Tuple instead of just Sequence, is because a range() counts a Sequence, but if you try to use one in a tag, it results in an error.
For
TagChildArg
, theIterable["TagChildArg"]
is too permissive, because it allows sets and dicts. For example, the type checker doesn't flag these, but these result in run-time errors: