Claudiu Popa, 02.03.2011 14:51:
Hello Python-list,


I  don't  know how to call it, but the following Python 3.2 code seems to raise 
a
FutureWarning.

def func(root=None):
     nonlocal arg
     if root:
        arg += 1
The  warning is "FutureWarning: The behavior of this method will change
in future versions.  Use specific 'len(elem)' or 'elem is not None' test 
instead."
Why is the reason for this idiom to be changed?

Let me guess - this is using ElementTree, right?

It's not the idiom itself that changes, it's the Element class in ElementTree that will likely change its behaviour in later versions.

Fix: do as it says.

Stefan

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to