[Python-Dev] textwrap and unicode

Martin v. Loewis martin@v.loewis.de
22 Oct 2002 21:58:07 +0200


Greg Ward <gward@python.net> writes:

> Here are the problems that I am aware of:
> 
>   * textwrap assumes "whitespace" means "the characters in
>     string.whitespace"

I don't know how precisely you want to formulate the property. If x is
a Unicode letter, then x.isspace() tells you whether it is a space
character (this property holds for all characters of the Zs category,
and all characters that have a bidirectionality of WS, B, or S).

>   * textwrap assumes "lowercase letter" means "the characters in
>     string.lowercase" (heck, this only works in English)

Works the same way: x.islower() tells you whether a character is
lower-case (meaning it is in the Ll category).

HTH,
Martin