If you adjust your keyfunc a little bit then you can achieve desired result.
Depending how agressive you would like to be in lowering you can use str.casefold or str.lower.
...and don't use
Depending how agressive you would like to be in lowering you can use str.casefold or str.lower.
...and don't use
list
as a name.>>> data = [['pencil', 'writing implement'], ['asteroid', 'space body'], ['Arctic', 'northern pole']] >>> sorted(data, key=lambda pair: pair[0].casefold()) [['Arctic', 'northern pole'], ['asteroid', 'space body'], ['pencil', 'writing implement']]
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.