[Python-3000] my take on "typeclasses"

Mike Krell mbk.lists at gmail.com
Thu May 11 22:35:52 CEST 2006


On 5/11/06, Guido van Rossum <guido at python.org> wrote:
> I think I'm more comfortable with a maximal taxonomy. In a maximal
> taxonomy, I'd describe a large set of invariants, attributes,
> behavior, etc., and say e.g. "this is how a file behaves". A
> particular class can then claim to be a file by explicitly declaring
> this (how that's spelled is a different issue -- it doesn't need to be
> done by inheritance from an abstract base class or interface, it could
> also be an arbitrary property, agreed upon by convention, or an
> external registry of all file types, for example).

If the route chosen is "agreed upon by convention" what is the
difference between this and duck typing?  Are the "claim" and
"convention" anything more than comments in the code?

   Mike


More information about the Python-3000 mailing list