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/038994.html below:

copysort patch, was RE: [Python-Dev] inline sort option

copysort patch, was RE: [Python-Dev] inline sort optionAlex Martelli aleaxit at yahoo.com
Sat Oct 18 17:12:38 EDT 2003
On Saturday 18 October 2003 10:54 pm, Dan Aloni wrote:
   ...
> Perhaps it could be made more understandable like:
>   >>> sorted = lambda x: x.sort() or x
>   >>> sorted(list(a))

No fair -- that's not a single expression any more!-)

> The only problem is that you assume .sort() always returns a non
> True value. If some time in the future .sort() would return self,
> your code would break and then the rightful usage would be:

Why do you think it would break?  It would do a _tiny_ amount of
avoidable work, but still return the perfectly correct result.  Sure
you don't think I'd post an unreadable inline hack that would break
in the unlikely case the BDFL ever made a change he's specifically
Pronounced again, right?-)


> I didn't see the begining of this discussion, but it looks to me that
> sort() returning self is much better than adding a .copysort().

The BDFL has Pronounced against it: he doesn't LIKE chaining.


Alex


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