1 |
On 11/13/2015 03:46 AM, Alexander Berntsen wrote: |
2 |
> On 11/11/15 22:33, Michał Górny wrote: |
3 |
>> Output a warning if LC_CTYPE is set to a value that causes libc |
4 |
>> toupper() and/or tolower() conversions not apply correctly to printable |
5 |
>> ASCII characters. |
6 |
> I think you a verb. |
7 |
> |
8 |
>> + "Please consider enabling another locale (such as " + |
9 |
>> + "en_US.UTF-8) in /etc/locale.gen and setting it " + |
10 |
>> + "as LC_TYPE in make.conf.") |
11 |
> Not sure this is really necessary. |
12 |
> |
13 |
>> + if uc != ruc: |
14 |
>> + msg.extend([ |
15 |
>> + " %s -> %s" % (''.join([chr(x) for x in lc]), |
16 |
>> + ''.join([chr(x) for x in ruc])), |
17 |
>> + " %28s: %s" % ('expected', |
18 |
>> + ''.join([chr(x) for x in uc]))]) |
19 |
>> + if lc != rlc: |
20 |
>> + msg.extend([ |
21 |
>> + " %s -> %s" % (''.join([chr(x) for x in uc]), |
22 |
>> + ''.join([chr(x) for x in rlc])), |
23 |
>> + " %28s: %s" % ('expected', |
24 |
>> + ''.join([chr(x) for x in lc]))]) |
25 |
> This is very silly. Even a for loop or list comprehension would be |
26 |
> better. |
27 |
> |
28 |
> |
29 |
|
30 |
Maybe use a lambda like this: |
31 |
|
32 |
charify = lambda sequence: ''.join(chr(x) for x in sequence) |
33 |
|
34 |
Note that square brackets are not needed, since a generator expression |
35 |
will suffice. |
36 |
-- |
37 |
Thanks, |
38 |
Zac |