[Python-Dev] New builtins
Paul Prescod
paul@prescod.net
Wed, 12 Jul 2000 04:55:11 -0500
"M.-A. Lemburg" wrote:
>
> ...
>
> Just for completeness: mx.Tools already has these APIs:
>
> tuples(sequence)
> Returns much the same as apply(map,(None,)+tuple(sequence)) does,
Like it.
> lists(sequence)
> Same as tuples(sequence), except that a tuple of lists is returned.
Like it.
> dict(items)
> Constructs a dictionary from the given items sequence.
Like it.
In my opinion, these are naturals for built-in functions. Cool!
These I'm not as sure about:
> irange(object[,indices])
> Builds a tuple of tuples (index,object[index]).
Isn't this just tuples( indices( object ), object )
> indices(object)
> Returns the same as tuple(range(len(object))) --
Could be obsoleted by the range-building syntax:
[0..len(object)]
would do the same thing.
--
Paul Prescod - Not encumbered by corporate consensus
Simplicity does not precede complexity, but follows it.
- http://www.cs.yale.edu/~perlis-alan/quotes.html