comparison test/mocknull.py @ 5461:ad8031290639

Python 3 compatibility for missing / mock value
author Christof Meerwald <cmeerw@cmeerw.org>
date Tue, 24 Jul 2018 21:39:37 +0100
parents a35d4cc8cd1a
children b1ab8bd18e79
comparison
equal deleted inserted replaced
5460:87f22a5d65ca 5461:ad8031290639
18 def __getitem__(self, key): return self 18 def __getitem__(self, key): return self
19 def __bool__(self): return False 19 def __bool__(self): return False
20 # Python 2 compatibility: 20 # Python 2 compatibility:
21 __nonzero__ = __bool__ 21 __nonzero__ = __bool__
22 def __contains__(self, key): return False 22 def __contains__(self, key): return False
23 def __eq__(self, rhs): return False
24 def __ne__(self, rhs): return False
23 def __str__(self): return '' 25 def __str__(self): return ''
24 def __repr__(self): return '<MockNull 0x%x>'%id(self) 26 def __repr__(self): return '<MockNull 0x%x>'%id(self)
25 def gettext(self, str): return str 27 def gettext(self, str): return str
26 _ = gettext 28 _ = gettext

Roundup Issue Tracker: http://roundup-tracker.org/