[Python-Dev] deprecating string module?
Steven Lott
s_lott@yahoo.com
Thu, 30 May 2002 09:01:34 -0700 (PDT)
I think the "nearly unanimous" is a bit overstated.
Some people like the older C-style free functions, but I think
this is just old habits fighting on until the bitter end.
My (perhaps wacko) preference is to carefully segregate
Strings and CharacterSets.
After all, iswhitespace() maps a fact about a character set
to a specific string instance.
I think that the classic ASCII, the various ISO 8859 variants,
and the Unicode character sets should
be objectified and their attributes include strings of
whitespace, uppercase, lowercase, etc., etc.
--- David Abrahams <david.abrahams@rcn.com> wrote:
> From: "Guido van Rossum" <guido@python.org>
>
>
> > > > These "use cases"
> > > > don't convince me that there's a legitimate use case for
> > > > string.letters etc. that the methods don't cover.
> > >
> > > This is funny. In the C++ community there's a nearly
> unanimous
> > > consensus that way too much of the functionality of the
> standard
> > > strings is expressed as member functions.
> >
> > Interesting. Python used to have the same attitude, hence
> the string
> > module -- but the existence of multiple string types made
> methods more
> > attractive.
> >
> > What's the alternative proposed for C++?
>
> Free functions at namespace scope. The analogy would be
> module-level
> functions in Python. C++ also has multiple string types, but
> the
> availability of overloading makes this approach practical (is
> it time for
> Python multimethods yet?)
>
> If I were to make arguments against string member functions in
> Python I'd
> be talking about the degree of coupling between algorithms and
> data
> structures, how it interferes with genericity, and the
> difficulty that
> users will have in making "string-like" types...
>
> but-i-would-never-make-such-silly-arguments-ly y'rs,
> dave
>
>
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev@python.org
> http://mail.python.org/mailman/listinfo/python-dev
=====
--
S. Lott, CCP :-{)
S_LOTT@YAHOO.COM
http://www.mindspring.com/~slott1
Buccaneer #468: KaDiMa
Macintosh user: drinking upstream from the herd.
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com