(no subject)

Tim Peters tim_one at email.msn.com
Thu Feb 24 22:56:06 EST 2000


[Def P]
> ...
> I still don't understand the benefit of string methods
> over oldfashioned string functions...

The string functions aren't going away, so feel free to ignore string
methods if they  don't appeal to you.

At heart, I think they were driven by the upcoming introduction of a new
Unicode string type.  Python 1.6 no longer has *a* string type, it's got
two.  Viewing the various string operations as abstract methods on a variety
of concrete string types is natural and appealing, while (possibly) adding a
pile of new string *functions* that work sensibly *only* on Unicode strings
(e.g., titlecase, byte-order mark fiddling, who knows?) would be unnatural
and unappealing.  Special methods in a subclass are natural.

Using string methods certainly "looks different" at first, but the
implementation has been available for several months (in the CVS development
tree), and people who have *used* string methods uniformly report that they
quickly come to like them (btw, "space.join(list)" is gorgeous!).

So give 'em a try, or stop whining <wink>.

in-the-end-guido-is-simply-mysterious-ly y'rs  - tim






More information about the Python-list mailing list