stchris / untangle

Converts XML to Python objects
MIT License
612 stars 83 forks source link

Support Element truthiness on Python 3 #68

Closed davidjb closed 2 years ago

davidjb commented 4 years ago

Python 3 changed __nonzero__ to __bool__ (https://portingguide.readthedocs.io/en/latest/core-obj-misc.html#customizing-truthiness-bool) -- this makes the standard class implementation Python 3 and provides an alias for Python 2 compatibility.

Previous to this change, all Element instances were considered false on Python 3.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.6%) to 35.494% when pulling 8e23f0d1fe2656c7361a5c2ba3eaca42ed59e576 on davidjb:truthiness into cd441fd6c3375430cca9443aea10e927f3d7fe68 on stchris:master.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.6%) to 35.494% when pulling 8e23f0d1fe2656c7361a5c2ba3eaca42ed59e576 on davidjb:truthiness into cd441fd6c3375430cca9443aea10e927f3d7fe68 on stchris:master.