Skip to content
Permalink
Browse files

[py3] Use __bool__ instead of __nonzero__

  • Loading branch information
m-kuhn committed May 22, 2016
1 parent 7e11384 commit ced7c27dcf2766d0429d35b4e902c2cca5c9817f
Showing with 3 additions and 6 deletions.
  1. +3 −6 python/PyQt/PyQt5/QtCore.py
@@ -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):
@@ -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__

0 comments on commit ced7c27

Please sign in to comment.
You can’t perform that action at this time.