mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Fixed #18963 -- Used a subclass-friendly pattern
for Python 2 object model compatibility methods.
This commit is contained in:
@@ -73,7 +73,9 @@ class Node(object):
|
||||
For truth value testing.
|
||||
"""
|
||||
return bool(self.children)
|
||||
__nonzero__ = __bool__ # Python 2
|
||||
|
||||
def __nonzero__(self): # Python 2 compatibility
|
||||
return type(self).__bool__(self)
|
||||
|
||||
def __contains__(self, other):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user