[Python-Dev] Adding Unicode methods to string objects
Tue, 07 Mar 2000 15:38:09 +0100
Fredrik Lundh wrote:
> > Unicode objects string objects
> > expandtabs
> I'm pretty sure there's "expandtabs" code in the
> strop module. maybe barry missed it?
> > center
> > ljust
> > rjust
> the implementation is trivial, and ljust/rjust are
> somewhat useful, so you might as well add them
> all (just cut and paste from the unicode class).
> what about rguido and lguido, btw?
Ooops, forgot those, thanks :-)
> > zfill
Why not ?
Since the string implementation had all of the above
marked as TBD, I added all four.
What about the other new methods (.isXXX() and .splitlines()) ?
.isXXX() are mostly needed due to the extended character
properties in Unicode. They would be new to the string object
.splitlines() is Unicode aware and also treats CR/LF
combinations across platforms:
S.splitlines([maxsplit]]) -> list of strings
Return a list of the lines in S, breaking at line boundaries.
If maxsplit is given, at most maxsplit are done. Line breaks are not
included in the resulting list.
Python Pages: http://www.lemburg.com/python/