On Thu, Jul 2, 2009 at 9:51 AM, David Glick<davidgl...@onenw.org> wrote:
> I think you need issubclass(t, Unauthorized) here, as it could be the
> Unauthorized from AccessControl.unauthorized which is a subclass of the one
> from zExceptions.

The definition [1] says:

isinstance(object, classinfo)
Return true if the object argument is an instance of the classinfo
argument, or of a (direct or indirect) subclass thereof.

and a short interpreter session confirms:

>>> class A():
...     pass
...
>>> class B(A):
...     pass
...

>>> a = A()
>>> b = B()

>>> isinstance(a, A)
True
>>> isinstance(a, B)
False

>>> isinstance(b, A)
True
>>> isinstance(b, B)
True

[1] http://docs.python.org/library/functions.html
_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to