Re: strop module and whitespace

hzsbg01!jbuhrma@hvgtw.att.com
Thu, 8 Jul 93 12:17:33 +0200

> Perhaps because \r is really a arbitrary control character (Python
> uses UNIX' convention that \n is the line separator). Or perhaps it's
> an oversight. What set of characters does ANSI C define to be
> whitespace? Should \f be added too?

Yes, and don't forget the Vertical Tab. I don't have any standards at
hand, but a simple program compiled on SunOS Release 4.1.3 (together
with data from ``man ascii'' and A2.5.2 from K&R's C manual (ANSI
version)) gives the following result:

HT ^I '\t' (0011) isspace
NL (LF) ^J '\n' (0012) isspace
VT ^K '\v' (0013) isspace
NP (FF) ^L '\f' (0014) isspace
CR ^M '\r' (0015) isspace
SP ' ' (0040) isspace

Can't strop use the ctype functions? At least Python will behave then
exactly like a C program would do.

You could perhaps string.py be automatically generated from a C program
that reflects that same ``local taste'' (if it would differ anyways from
what's defined in some standard).

> Feedback, please!

Here you are...

-- Jan-Hein Buhrman -- AT&T Huizen NL -- <jbuhrma%hzsbg01@hvlpa.att.com> --
---------------------- +31 35 87.4278 --- ...!att!hvlpa!hzsbg01!jbuhrma ---
``There is a severe danger that we might finish the program today''