Op 2005-12-14, Christopher Subich schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Suppose we would add type declarations in python. >> So we could do things like >> >> int: a >> object: b >> >> Some people seem to think that this would introduce static >> typing, but the only effect those staments need to have >> is that each time a variable is rebound an assert statement >> would implicitly be executed, checking whether the variable is >> still an instance of the declared type. > > Doesn't work; duck typing is emphatically not subclass-typing.
I don't see how that is relevant. > For this > system to still work and be as general as Python is now (without having > to make all variables 'object's), But the way Guido wants python to evolve would make all variables objects. This is what PEP 3000 states. Support only new-style classes; classic classes will be gone. As far as I understand this would imply that all classes are subclasses of object and thus that isinstance(var, object) would be true for all variables. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list