[Zope] type() and types

Chris Meyers chris@hddesign.com
Tue, 30 Jul 2002 14:09:51 -0500


On Tue, Jul 30, 2002 at 11:52:46AM -0700, Dennis Allison wrote:
> The type() function is exceptionally usful for debugging but is unavailabe
> in python scripts for security reasons.  In my debug framework I would like
> to re-enable it.  Since it's a built-in just configuring to allo the import
> of types isn't enough.  What's the hack.
> 

You can use same_type(x,y) without any special imports in python scripts.

example:

if same_type(x,[]):
  #do something
else:
  print 'x is not a list'

HTH,
Chris

> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

-- 
Chris Meyers
Huttleston Data Design
7941 Tree Lane Suite 200
Madison WI 53717