[Zope] Re: type in python scripts

Dieter Maurer dieter at handshake.de
Wed Jun 2 17:58:05 EDT 2004


David A. Riggs wrote at 2004-6-1 18:40 -0400:
> ...
>but why on earth can't I ask
>for an object's type?

Because, in many cases the result would surprise you...

  "type" applied to almost any Zope object will not give
  you "Instance" (as you would expect in a pure Python application)
  but "ImplicitAcquirer Wrapper" (or something like this).

  Moreover, access to any object returned by type
  would give you an "Unauthorized" (as these objects
  do not carry the necessary security declarations).

  As a consequence, "type" would be (practically) unusable,
  even when you could call it.

Use "same_type" instead.

-- 
Dieter



More information about the Zope mailing list