Re: strop module and whitespace

lance@markv.com
Thu, 8 Jul 93 9:48:30 PDT

> 1) why is \r not considered whitespace?

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?

> 2) even if I fix whitespace in string.py, it is not being picked up
> because it has been hardcoded in module strop to be space, \t and
> \n. (string.py imports strop.)

Same reason, and I thought it wasn't ever going to matter. Do you
think it is sufficient if I fix this by adding \r (and \f) to the
hardcoded list, or do you think we'll need a more general routine?

A possibility, if people think this is worth it, would be to somehow
find out which characters the C library's "isspace()" function
considers whitespace and use this definition throughout.

Feedback, please!

Why not have the module at import time scan the ascii table and use
isspace() to find out the actual white space characters.. This would
not take much time and would only be done with the first instance of the
imported module. This will make it 100% machine independent.

Comments?

Lance Ellinghouse
lance@markv.com