[Python-3000] callable()

Guido van Rossum guido at python.org
Fri Jul 21 02:32:20 CEST 2006


On 7/20/06, Raymond Hettinger <rhettinger at ewtllc.com> wrote:
>
> >> Why is this a defect?  Have we abandoned the notion of SeqIter
> >> automatically wrapping any object with __getitem__()?
> >
> >
> > Actually, the autowrapping was intended a backwards compatibility
> > measure.
> >
> > We should make a conscious decision whether we should make it a
> > permanent feature or not.
>
> It sure simplified writing extensions.
> And it provided a convenient guarantee that all sequences are iterable.
> I don't see a downside to keeping it.

Well, it will also make mappings pseudo-iterable; in Py3k I plan to
completely get rid of the distinction between x[...] for mappings and
for sequences, which exist in C but not at the Python level.

I'd like to hear from others whether the default iter fallback ought
to stay or go.

> > (I also think that the two-argument form
> > iter(function, sentinel) is not very successful or useful and might be
> > dropped, but that's a separate issue.)
>
> This functionality should be moved to itertools.
> That will clear-up the odd function signature for iter().
> As it stands now, the function/sentinel form suffers from invisibility.

That doesn't matter much since there are very few uses for it.

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


More information about the Python-3000 mailing list