[Tutor] unicode: alpha, whitespaces and digits
Steven D'Aprano
steve at pearwood.info
Mon Dec 30 00:03:14 CET 2013
On Mon, Dec 30, 2013 at 09:58:10AM +1100, Steven D'Aprano wrote:
> What gives you that impression? isspace works on Unicode strings too.
>
> py> ' x'.isspace()
> False
> py> ' '.isspace()
> True
Oops, the above was copied and pasted from Python 3, which is why there
are no u' prefixes. But it still holds in Python 2:
py> u' '.isspace()
True
py> u' x'.isspace()
False
Sorry for any confusion.
--
Steven
More information about the Tutor
mailing list