mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
[py3] Replaced __nonzero__ by __bool__
Of course, __nonzero__ alias has been kept for Python 2 compatibility.
This commit is contained in:
@@ -68,11 +68,12 @@ class Node(object):
|
||||
"""
|
||||
return len(self.children)
|
||||
|
||||
def __nonzero__(self):
|
||||
def __bool__(self):
|
||||
"""
|
||||
For truth value testing.
|
||||
"""
|
||||
return bool(self.children)
|
||||
__nonzero__ = __bool__ # Python 2
|
||||
|
||||
def __contains__(self, other):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user