comparison mercurial/util.py @ 34139:be00af4a1ac5

doctest: coerce dict.keys() to list Otherwise it would be printed as odict_keys([...]) on Python 3.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Sep 2017 17:33:10 +0900
parents a8994d08e4a2
children 3bb2a9f25fe9
comparison
equal deleted inserted replaced
34138:0f9936d80e01 34139:be00af4a1ac5
582 >>> d1 = sortdict([(b'a', 0), (b'b', 1)]) 582 >>> d1 = sortdict([(b'a', 0), (b'b', 1)])
583 >>> d2 = d1.copy() 583 >>> d2 = d1.copy()
584 >>> d2 584 >>> d2
585 sortdict([('a', 0), ('b', 1)]) 585 sortdict([('a', 0), ('b', 1)])
586 >>> d2.update([(b'a', 2)]) 586 >>> d2.update([(b'a', 2)])
587 >>> d2.keys() # should still be in last-set order 587 >>> list(d2.keys()) # should still be in last-set order
588 ['b', 'a'] 588 ['b', 'a']
589 ''' 589 '''
590 590
591 def __setitem__(self, key, value): 591 def __setitem__(self, key, value):
592 if key in self: 592 if key in self: