Skip to content

Commit 900be9f

Browse files
committedSep 29, 2017
Properly report QgsDefaultValue.__bool__ in Python
1 parent f2d512a commit 900be9f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎python/core/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ def _geometryNonZero(self):
4141
return not self.isEmpty()
4242

4343

44+
def _isValid(self):
45+
return self.isValid()
46+
4447
QgsGeometry.__nonzero__ = _geometryNonZero
4548
QgsGeometry.__bool__ = _geometryNonZero
4649

50+
QgsDefaultValue.__bool__ = _isValid
51+
4752

4853
def register_function(function, arg_count, group, usesgeometry=False,
4954
referenced_columns=[QgsFeatureRequest.ALL_ATTRIBUTES], **kwargs):

0 commit comments

Comments
 (0)
Please sign in to comment.