gah! I hate the new string syntax
Alex Martelli
aleaxit at yahoo.com
Sun Mar 11 03:08:41 EST 2001
"Amit Patel" <amitp at Xenon.Stanford.EDU> wrote in message
news:98elrk$li8$1 at nntp.Stanford.EDU...
[snip]
> What I mean to say is that I cannot write new methods on strings. So
Perfectly true, just as you cannot on dictionaries, lists, tuples,
file objects, and so on. Only classes and extension-classes
are extensible (by inheritance and overriding), not types.
> has control over the string class. Since I don't control the string
> class, I have to use a different syntax than someone who does have
> control over the string class gets to use. That seems okay if the
> function is some essential part of that class. But it seems "wrong"
> if the function is there merely for convenience.
string is not a class -- it's a type. To many, the split seems wrong
_all_ of the time. I may be one of the few that sees some pluses
in the distinction (!), but it does complicate things, and is a strong
candidate for "aspect of Python fewest Pythonistas _like_":-).
Alex
More information about the Python-list
mailing list