Skip to content

Commit 2e12984

Browse files
committed
xpath - Make null str() to empty string
1 parent d26a6b9 commit 2e12984

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

AdvancedHTMLParser/xpath/null.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ def __ne__(self, other):
2929

3030
return not bool( isinstance(other, NullType) )
3131

32+
def __str__(self):
33+
'''
34+
__str__ - Return a string representation
35+
'''
36+
# For xpath, we treat Null like empty string in most cases
37+
return ''
3238

3339
# Null - Singleton for the NullType
3440
Null = NullType()

0 commit comments

Comments
 (0)