What about an EXPLICIT naming scheme for built-ins?
Antoon Pardon
apardon at forel.vub.ac.be
Mon Sep 6 08:18:24 EDT 2004
Op 2004-09-04, Alex Martelli schreef <aleaxit at yahoo.com>:
> Jp Calderone <exarkun at divmod.com> wrote:
> ...
>> They are new. There is no reason to worry about breaking
>> compatibility. Why sequences and not iterators? I would prefer the
>
> sorted returns a sequence (a list) because it must build one anyway, and
> it would be a waste NOT to return it in the several cases in which you
> want one. list(iter(list(something))) is simply a stupid waste...
But I think it would be nice to have a naming convention that made
it clear whether you got an iterator or a sequence (list).
If we would use names like ranging, reversing ... when an iterator
is returned and sorted, ... when a sorted copy of the sequence
is returned I think that would greatly help people in understanding
what is going on.
--
Antoon Pardon
More information about the Python-list
mailing list