[Zope] Checking object's class

Thierry FLORAC thierry.florac@onf.fr
Mon, 31 Mar 2003 09:43:06 +0200


On Monday 24 March 2003 19:53, Dieter Maurer wrote:
> Thierry FLORAC wrote at 2003-3-24 09:59 +0100:
>  > ...
>  >  - is it better to test for "object.meta_type"
>
> Drawback:
>
>   no inheritance check
>
>  > or "isinstance (object, class)"
>
> Drawback:
>
>   you usually need "object.aq_base".
>
>   It's more expensive than a simple "meta_type" check.

OK.
But is it possible to give the same meta_type to a base class and it's 
inherited ones (as long as I have other properties to distinguish instances 
of these classes) ??

Thanks,

  Thierry