File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -34,25 +34,23 @@ def __getitem__(self, key):
34
34
return dict .get (self , key , self .default )
35
35
36
36
37
- # Some utility functions to dal with weirdness around UCS2 vs UCS4
38
- # python builds
39
-
40
37
def isSurrogatePair (data ):
38
+ """Check whether a string is a surrogate pair or not"""
41
39
return (len (data ) == 2 and
42
40
ord (data [0 ]) >= 0xD800 and ord (data [0 ]) <= 0xDBFF and
43
41
ord (data [1 ]) >= 0xDC00 and ord (data [1 ]) <= 0xDFFF )
44
42
45
43
46
44
def surrogatePairToCodepoint (data ):
45
+ """Convert a surrogate pair to a codepoint"""
47
46
char_val = (0x10000 + (ord (data [0 ]) - 0xD800 ) * 0x400 +
48
47
(ord (data [1 ]) - 0xDC00 ))
49
48
return char_val
50
49
51
- # Module Factory Factory (no, this isn't Java, I know)
52
- # Here to stop this being duplicated all over the place.
53
-
54
50
55
51
def moduleFactoryFactory (factory ):
52
+ """Module Factory Factory (no, this isn't Java, I know)
53
+ Here to stop this being duplicated all over the place."""
56
54
moduleCache = {}
57
55
58
56
def moduleFactory (baseModule , * args , ** kwargs ):
You can’t perform that action at this time.
0 commit comments