[Python-Dev] decorate-sort-undecorate

Guido van Rossum guido at python.org
Mon Oct 13 18:07:48 EDT 2003


> I've seen proposals for an extension to list comprehension, which would 
> be quite nice:
>> [s for s in lst sortby s.lower()]
>> It reads nicely, and avoids lambdas and tiny helper functions. Also 
> handles the sort-returns-None criticism. But it adds syntax. And 
> since it's not an in-place sort it won't perform as well (but probably 
> better than the decorator idiom anyway...?)

This has a very low probability to be accepted. It suffers IMO from
the "SQL syndrome": having reserved words to the language that are
only meaningful in a very specific syntax yet are reserved
everywhere. Until we have a general way to avoid that, I'd rather
not go that route.
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /