← Back to context

Comment by est

10 hours ago

I am curious, why not .lower().translate('_.', '--')

.lower() has to handle Unicode, right? I imagine the giant tables slow it down a bit.

  • It's so annoying how so many languages lack a basic "ASCII lowercase" and "ASCII uppercase" function. All the Unicode logic is not only unnecessary, but actively unwanted, when you e.g want to change the case of a hex encoded string or do normalization on some machine generated ASCII-only output.