Joe Strout wrote:
So, the level of assertion that I want to make in a method that expects a Duck is just that its parameter is either a Duck, or something that the caller is claiming is just as good as a Duck.
I'm not sure, but I think the new ABC stuff in Py3 is going to provide something like this, in that there will be a way to declare that a class conforms to the Duck interface even if it doesn't inherit from it. Then you can just test isinstance(x, Duck). -- Greg -- http://mail.python.org/mailman/listinfo/python-list