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/2003-October/039828.html below:

[Python-Dev] Re: Guido's Magic Code was: inline sort option

[Python-Dev] Re: Guido's Magic Code was: inline sort optionGuido van Rossum guido at python.org
Thu Oct 30 10:43:04 EST 2003
> >     a = [3,2,1]
> >     print a.sorted()
> >     print list.sorted(a)
> 
> Actually, yes, it IS compelling indeed.  Funny -- I was originally just
> brainstorming / musing out loud, never thought about this as a "real
> thing".  But now that it's matured a bit, I do feel sure [...]

If you feel about it that way, I recommend that you let it mature a
bit more.

If you really like this so much, please realize that you can do this
for *any* instance method.  The identity

   C.foo(C()) == C().foo()

holds for all "regular" methods.  (Since 2.2 it also holds for
extension types.)  If we were to do this, we'd be back at square two,
which we rejected: list instances having both a sort() and a sorted()
method (square one being no sorted() method at all :-).

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list

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