For code that manipulates element trees, it's handy to be able to check what kind of a node a function is dealing with.
As of 1.0.0, only Soup.is_element is exposed in the public API. Soup.is_document exists internally but isn't exposed, and Soup.is_text doesn't exist at all. All three are trivial to add and expose.
This PR exposes a complete set of node type checks.
If you want me to add tests for those functions, I can do it as well.
For code that manipulates element trees, it's handy to be able to check what kind of a node a function is dealing with.
As of 1.0.0, only
Soup.is_element
is exposed in the public API.Soup.is_document
exists internally but isn't exposed, andSoup.is_text
doesn't exist at all. All three are trivial to add and expose.This PR exposes a complete set of node type checks.
If you want me to add tests for those functions, I can do it as well.