[Python-3000] Builtin iterator type

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Nov 17 03:54:25 CET 2006


George Sakkis wrote:

> And for two, not everyone feels comfortable with duck typing. People
> who consider (for better or for worse) isinstance() safer than
> hasattr()/getattr() would be accomodated too.

The trouble is that building things into the core to
"accommodate" these people ends up making things worse
for people who don't subscribe to that school of
thought, because they will trip over places where
some type won't be acceptable because it doesn't
inherit from the right bases, even though it
implements all the functionality required for their
application.

I would suggest that if someone is that uncomfortable
with duck typing, then perhaps Python is not the
right language for them. Even if the language itself
is neutral on the matter, the culture and the body
of code libraries that has grown up around it is
not. There's a clear preference in favour of duck
typing and against LYBL techniques. If you don't
go with that flow, your code will have trouble
interoperating with that of others.

--
Greg


More information about the Python-3000 mailing list