/usr/share/pyshared/simpleparse/tests/genericvalues.py is in python-simpleparse 2.1.0a1-6build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | """Values to match result-trees even when implementations change
These values match the "logical" values of the result-trees
as they apply to SimpleParse's usage, rather than the particular
concrete results returned by the engine. So, for instance, you
can say "returns no children" (NullResults) for result-tuples or
"whatever failure position" for failure return values.
"""
class _NullResults:
def __cmp__( self, other ):
if other == [] or other == None:
return 0
else:
return -1
def __repr__( self ):
return "<Null Children>"
NullResult = _NullResults()
class _AnyInt:
def __cmp__( self, other ):
if type(other) == type(1):
return 0
else:
return -1
def __repr__( self ):
return "<Any Integer>"
AnyInt = _AnyInt()
|