[Python-3000] Builtin iterator type

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Nov 18 02:21:35 CET 2006


Bill Janssen wrote:
> The use of standard base types (interfaces)
> is basically a communications mechanism that lets functionality
> designers easily tell users of their functionality what's needed.

But it's a blunt tool, because it arbitrarily lumps
together sets of functionality that often are not
required in their entirety. Unless you break the
interfaces down to the level of single methods,
in which case you might as well just document which
methods are required -- as we do now, and it seems
to work fairly well.

> Checking for some textual attributes of a
> type

Now you're talking about LYBL, which is generally
considered an anti-pattern in Python. APIs should
be designed so that you don't need to test for the
presence of features.

> I think that lots of folks aren't exactly uncomfortable with it.
> It's more that they see it as a blemish on what's otherwise a pretty
> good language...  They
> contribute suggestions about how to remove the necessity for it

But this is a fundamental difference of opinion about
what is desirable and what is not. From what you've
said, they see duck typing as a necessary evil, something
to be put up with. Whereas the rest of us see it as a
*good* thing that rescues us from the hell of having to
tediously declare all our interfaces and variable types.
These are opposite and irreconcilable points of view,
as far as I can see.

--
Greg


More information about the Python-3000 mailing list