[issue3195] invalid conversion xml.etree.ElementTree.Element object to boolean

2008-06-25 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- resolution: -> invalid status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue3195] invalid conversion xml.etree.ElementTree.Element object to boolean

2008-06-25 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Indeed, this is not a bug, although it can be misleading. Generally, if you test for None, it is better to write "if x is None", it is at the same time more accurate, more explicit for someone reading your code, and also executes faster than "

[issue3195] invalid conversion xml.etree.ElementTree.Element object to boolean

2008-06-25 Thread Andrii V. Mishkovskyi
Andrii V. Mishkovskyi <[EMAIL PROTECTED]> added the comment: To quote Python Library Reference, paragraph 3.1: """Any object can be tested for truth value, for use in an if or while condition or as operand of the Boolean operations below. The following values are considered false: [skipped] - i

[issue3195] invalid conversion xml.etree.ElementTree.Element object to boolean

2008-06-25 Thread Pavel Strashkin
New submission from Pavel Strashkin <[EMAIL PROTECTED]>: Python 2.5.2 (r252:60911, May 7 2008, 15:19:09) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from xml.etree.ElementTree import Element >>> e = Element('Test', {'at