Skip to content

Commit

Permalink
[py3] Use __bool__ instead of __nonzero__
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed May 22, 2016
1 parent 7e11384 commit ced7c27
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions python/PyQt/PyQt5/QtCore.py
Expand Up @@ -8,11 +8,8 @@
_QVariant__hash__ = QVariant.__hash__


def __nonzero__(self):
if self.isNull():
return False
else:
return True
def __bool__(self):
return not self.isNull()


def __repr__(self):
Expand Down Expand Up @@ -42,7 +39,7 @@ def __hash__(self):
else:
return _QVariant__hash__(self)

QVariant.__nonzero__ = __nonzero__
QVariant.__bool__ = __bool__
QVariant.__repr__ = __repr__
QVariant.__eq__ = __eq__
QVariant.__ne__ = __ne__
Expand Down

0 comments on commit ced7c27

Please sign in to comment.