[Python-3000] Builtin iterator type

Bill Janssen janssen at parc.com
Wed Nov 15 04:53:36 CET 2006


Greg Ewing wrote:
> Bill Janssen wrote:
> 
> > Duck typing is a seriously bad idea, forced on Python by the now
> > obsolete split between built-in types and user-defined types.
> 
> Non-duck typing is a seriously bad idea, forced
> on some other languages by static typing. Python
> is mercifully free of such constraints.

I'm thinking that Mike Orr's question, "are we all talking about the
same duck-typing", makes sense.  Greg, I'm not suggesting static
typing -- I much prefer dynamic strong typing.  But what Python has
now is dynamic weak typing, which makes programs (particularly
frameworks) fragile.  And it's mainly due to the historical accident
of not being able to inherit from C-based types in Python 1.x.

I'd like to be able to look at a value and determine which interfaces
I can safely invoke on it, even if I don't understand its full type.
I can't (safely) do that by string-matching method names.

Bill


More information about the Python-3000 mailing list