I'm not sure if lowercase is the better decision, so I'm filing this feedback for discussion.
Reasons to favor lowercase:
-
repr() uses lowercases:
>>> "\x1B"
'\x1b'
>>> "\u200B"
'\u200b'
>>> "\U0001F977"
'\U0001f977'
-
I sampled 500K files from our codebase, lowercase is bit more popular (the count below is the total number escape sequences in strings):
\x escapes:
- lowercase: 440K
- uppercase: 351K
- no letters: 341K
\u escapes:
- lowercase: 144K
- uppercase: 49K
- no letters: 46K
(This might actually be a reason to not have a preference, since this is polarized.)
Reasons to favor uppercase:
- For
\x escapes, Black already uses uppercase for hex numbers: 0xEF, so this will be consistent with Black itself.
- For unicodes, https://unicode.org/ uses uppercases.
I personally think the uppercase reasons are stronger.
I'm not sure if lowercase is the better decision, so I'm filing this feedback for discussion.
Reasons to favor lowercase:
repr()uses lowercases:I sampled 500K files from our codebase, lowercase is bit more popular (the count below is the total number escape sequences in strings):
\xescapes:\uescapes:(This might actually be a reason to not have a preference, since this is polarized.)
Reasons to favor uppercase:
\xescapes, Black already uses uppercase for hex numbers:0xEF, so this will be consistent with Black itself.I personally think the uppercase reasons are stronger.