We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3115c30 commit 8392c93Copy full SHA for 8392c93
python/__init__.py
@@ -22,3 +22,15 @@
22
__copyright__ = '(C) 2007, Martin Dobias'
23
# This will get replaced with a git SHA1 when you do a git archive
24
__revision__ = '$Format:%H$'
25
+
26
+from PyQt4.QtCore import QPyNullVariant
27
+from types import MethodType
28
29
+# Add a __nonzero__ method onto QPyNullVariant so we can check for null values easier.
30
+# >>> value = QPyNullVariant("int")
31
+# >>> if value:
32
+# >>> print "Not a null value"
33
+def __nonzero__(self):
34
+ return False
35
36
+QPyNullVariant.__nonzero__ = MethodType(__nonzero__, None, QPyNullVariant)
0 commit comments