Bruno Desthuilliers wrote: > And *this* is highly unpythonic. And un-OO too, since it makes foo() > dependant on *class* Bar, when it should most probably be enough that it > only depends on (probably part of) the *interface* of class Bar.
I was providing the original poster with a simple way to ensure appropriate type. You can assert whatever aspect you wish. If you want to ensure compatibility with some other property simply use "assert blah" subsituting blah for whatever test you wish to perform (e.g. assert MyInterface.implementedBy(bar) to test for interface implementation). -- http://mail.python.org/mailman/listinfo/python-list