Mr.Rech wrote:
> All in all it seems that the implementation that uses isinstance() is
> better in this case...

Well what's "better" depends on what you want to happen when you compare 
an unrelated class that also defines 'an_attribute'. Unlike in 
statically typed languages, certain things are made easier when you 
don't check for strict inheritance (like mock and proxy objects). Google 
"Duck Typing" for more info.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to