What about an EXPLICIT naming scheme for built-ins?
Andrew Dalke
adalke at mindspring.com
Sun Sep 5 17:37:07 EDT 2004
Alex Martelli wrote:
> Or, vastly better IMHO, one could equivalently code.
>
> reversed_list = list(reversed(mylist))
>
> I don't understand why some people want to use list comprehensions
> instead of simple calls to list().
As for me, it's because until recently with generators
I very rarely used list() while I frequently use list
comprehensions. When I think "I need a list" I therefore
am more prone to remember comprehensions first.
With generators becoming more common it's been easier
for me to remember that list() is the appropriate solution.
"There should be one -- and preferably only one --
obvious way to do it."
Does that suggest that we should have had list() +
generator comprehensions and not have list comprehensions?
Andrew
dalke at dalkescientific.com
More information about the Python-list
mailing list