Currently, PyHTML accepts any data as an argument for an element. Although this is technically true, as all data will be stringified before being rendered, using certain types often leads to garbled output.
>>> import pyhtml as p
>>> str(p.p({ "i": p.i("italics"), "b": p.b("bold") }))
'<p>\n {'i': <i>\n italics\n</i>, 'b': <b>\n bold\n</b>}\n</p>'
We should add constraints to these argument types so that static analysis tools can prevent users from unintentionally writing this (often unintentional) code.
Currently, PyHTML accepts any data as an argument for an element. Although this is technically true, as all data will be stringified before being rendered, using certain types often leads to garbled output.
We should add constraints to these argument types so that static analysis tools can prevent users from unintentionally writing this (often unintentional) code.