comparison mercurial/encoding.py @ 32291:bd872f64a8ba

cleanup: use set literals We no longer support Python 2.6, so we can now use set literals.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 10 Feb 2017 16:56:29 -0800
parents 1a3a08b5d4d5
children 7040f5131454
comparison
equal deleted inserted replaced
32290:2959c3e986e0 32291:bd872f64a8ba
28 _ignore = [unichr(int(x, 16)).encode("utf-8") for x in 28 _ignore = [unichr(int(x, 16)).encode("utf-8") for x in
29 "200c 200d 200e 200f 202a 202b 202c 202d 202e " 29 "200c 200d 200e 200f 202a 202b 202c 202d 202e "
30 "206a 206b 206c 206d 206e 206f feff".split()] 30 "206a 206b 206c 206d 206e 206f feff".split()]
31 # verify the next function will work 31 # verify the next function will work
32 if pycompat.ispy3: 32 if pycompat.ispy3:
33 assert set(i[0] for i in _ignore) == set([ord(b'\xe2'), ord(b'\xef')]) 33 assert set(i[0] for i in _ignore) == {ord(b'\xe2'), ord(b'\xef')}
34 else: 34 else:
35 assert set(i[0] for i in _ignore) == set(["\xe2", "\xef"]) 35 assert set(i[0] for i in _ignore) == {"\xe2", "\xef"}
36 36
37 def hfsignoreclean(s): 37 def hfsignoreclean(s):
38 """Remove codepoints ignored by HFS+ from s. 38 """Remove codepoints ignored by HFS+ from s.
39 39
40 >>> hfsignoreclean(u'.h\u200cg'.encode('utf-8')) 40 >>> hfsignoreclean(u'.h\u200cg'.encode('utf-8'))