Python 3: set __bool__() method on Namespace

The Python 2 __nonzero__() method was renamed to __bool__() in Python 3.

Create a __bool__ alias to __nonzero__ in the Namespace class.

Change-Id: I2ad3b3522b9ee2d33a5eee8886ee5f07776fb449
This commit is contained in:
Victor Stinner 2015-05-15 18:30:08 +02:00
parent 253a6288e8
commit a6b0ca69ce

View File

@ -89,3 +89,4 @@ class Namespace(object):
def __nonzero__(self):
return len(self.__dict__) > 0
__bool__ = __nonzero__