[Zope] how to get info about an object (dir/type)

Andreas Jung lists at andreas-jung.com
Thu Jun 30 08:08:16 EDT 2005



--On 30. Juni 2005 14:04:14 +0200 gabor <gabor at nekomancer.net> wrote:

> Andreas Jung wrote:
>>
>>
>> --On 30. Juni 2005 13:48:19 +0200 gabor <gabor at nekomancer.net> wrote:
>>
>>> hi,
>>>
>>> while working with zope, i many times have the following problem:
>>>
>>> i find a method that i can use, and the documentation (for example)
>>> says: "returns the current user".
>>>
>>> ok, but what kind of object is it?
>>> what methods does it have?
>>>
>>
>> lib/python/AccessControl/User.py is your friend.
>>
>
> thanks for your help,
>
> but .. it is not about this specific issue (about the current user)..
>
> generally.. if i have a reference to an object.
> how do i find out what his methods are?


By determining its class or meta_type and then by checking the related 
documentation, source code of the class or its base classes? Of course
type() does not work in RestrictedPython. Bascially you should know the 
objects you're dealing with...otherwise this sounds like a problem with 
your application to me :-) Otherwise use type() from within unrestricted 
code.

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20050630/52e93366/attachment.bin


More information about the Zope mailing list