2 ms·
The purpose of capitalize is not “present this as you would on a nametag, with the first letter as a capital and the rest lowercase unless its a two-letter name
by dragonwriter 4y ago
The purpose of capitalize is not “present this as you would on a nametag, with the first letter as a capital and the rest lowercase unless its a two-letter name, and then make both capital”.
Now, if that’s the behavior you want, then, yes, capitalize is wrong, but capitalize shouldn’t be “fixed” around that special use case, you should write a function that does what you want.
Python did, until recently, have a problem with capitalize that was, I guess, a “big-J” problem instead of this “small-j” problem, dealing with non-ASCII letters: https://github.com/python/cpython/issues/80730 https://github.com/python/cpython/issues/80730