[Python-checkins] r63170 - python/trunk/Doc/library/functions.rst

Guido van Rossum guido at python.org
Mon May 12 20:49:17 CEST 2008


Yeah, tha parameter name was a mistake. Please change for Py3k. I
guess the docs are the best we can do for 2.6.

Personally, I wonder if such parameters shouldn't be positional-only;
that avoids some silliness.

On Mon, May 12, 2008 at 10:50 AM, Georg Brandl <g.brandl at gmx.net> wrote:
> Guido van Rossum schrieb:
>
>
>
> > On Mon, May 12, 2008 at 10:09 AM, Raymond Hettinger <python at rcn.com>
> wrote:
> >
> > > [Georg]
> > >
> > >
> > > > Fix parameter name for enumerate().
> > > >
> > >
> > >
> > > > -.. function:: enumerate(iterable)
> > > > +.. function:: enumerate(sequence)
> > > >
> > > > -   Return an enumerate object. *iterable* must be a sequence, an
> > > :term:`iterator`, or some
> > > >
> > >
> > >  I don't understand this change.  Why is *iterable* not correct?
> > >  Elsewhere, we've taken sequence to mean something with __getitem__ and
> > > __len__
> > >  while iterable means something that responds nicely to iter(obj).
> > >
> >
> > I'm with Raymond -- in 3.0 we even added Iterable to the small set of
> > standard ABCs. A *Sequence* is defined there too, and has a much more
> > elaborate API (e.g. slicing and indexing). The whole point of things
> > like enumerate() is that it *doesn't* require all that -- it is
> > anything for which iter() can return an iterator. (And yes, *Iterator*
> > is another ABC in 3.0.)
> >
>
>  That may be right, but enumerate() takes keyword arguments and the keyword
>  name for that parameter is "sequence". (We can of course change that for
>  Py3k, if you like.)
>
>  Georg
>
>  --
>  Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
>  Four shall be the number of spaces thou shalt indent, and the number of thy
>  indenting shall be four. Eight shalt thou not indent, nor either indent
> thou
>  two, excepting that thou then proceed to four. Tabs are right out.
>
>
>
>  _______________________________________________
>  Python-checkins mailing list
>  Python-checkins at python.org
>  http://mail.python.org/mailman/listinfo/python-checkins
>



-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-checkins mailing list