MCPcopy Index your code
hub / github.com/numpy/numpy / english_lower

Function english_lower

numpy/_core/_string_helpers.py:16–41  ·  view source on GitHub ↗

Apply English case rules to convert ASCII strings to all lower case. This is an internal utility function to replace calls to str.lower() such that we can avoid changing behavior with changing locales. In particular, Turkish has distinct dotted and dotless variants of the Latin letter

(s)

Source from the content-addressed store, hash-verified

14
15
16def english_lower(s):
17 """ Apply English case rules to convert ASCII strings to all lower case.
18
19 This is an internal utility function to replace calls to str.lower() such
20 that we can avoid changing behavior with changing locales. In particular,
21 Turkish has distinct dotted and dotless variants of the Latin letter "I" in
22 both lowercase and uppercase. Thus, "I".lower() != "i" in a "tr" locale.
23
24 Parameters
25 ----------
26 s : str
27
28 Returns
29 -------
30 lowered : str
31
32 Examples
33 --------
34 >>> from numpy._core.numerictypes import english_lower
35 >>> english_lower('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_')
36 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789_'
37 >>> english_lower('')
38 ''
39 """
40 lowered = s.translate(LOWER_TABLE)
41 return lowered
42
43
44def english_upper(s):

Callers

nothing calls this directly

Calls 1

translateMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…