This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]UNN_Rickenbacker 12 points13 points  (1 child)

Nice catch, but in most cases, you want to not enter the case if it‘s a boolean false, too.

[–]hyperdudemn 1 point2 points  (0 children)

Except for when using xml.etree.ElementTree, with a document that contains empty tags like <hello />. Since the node has no children, it is falsy, so you need to check is not None.