In the “string” module of the standard library,
string.ascii_letters ## Same as string.ascii_lowercase + string.ascii_uppercase
is
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
Is there a similar constant which would include everything that is considered a letter in unicode?
You can construct your own constant of Unicode upper and lower case letters with:
This makes a string 2153 characters long (narrow Unicode Python build). For code like
letter in unicode_lettersit would be faster to use a set instead: