A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-December/011082.html below:

[Python-Dev] Death to string functions!

[Python-Dev] Death to string functions!Peter Funk pf@artcom-gmbh.de
Sun, 17 Dec 2000 18:40:06 +0100 (MET)
[string.function(S, ...) vs. S.method(...)]

Guido van Rossum:
> I don't believe one bit of this.  By that standard, we would do better
> to define a new module "list" and start writing list.append(L, x) for
> L.append(x).

list objects have only very few methods.  Strings have so many methods.  
Some of them have names, that clash easily with the method names 
of other kind of objects.  Since there are no type declarations in
Python, looking at the code in isolation and seeing a line
	i = string.index(some_parameter)
tells at the first glance, that some_parameter should be a string
object even if the doc string of this function is too terse.  However
in 
	i = some_parameter.index()
it could be a list, a database or whatever.  

> You are entitled to your opinion, but given that your arguments seem
> very weak I will continue to ignore it (except to argue with you :-).

I see.  But given the time frame that the string module wouldn't
go away any time soon, I guess I have a lot of time to either think
about some stronger arguments or to get finally accustomed to that
new style of coding.  But since we have to keep compatibility with
Python 1.5.2 for at least the next two years chances for the latter
are bad.

Regards and have a nice vacation, Peter



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4