[Zope] Test variable data type

Geir Bækholt Geir Bækholt
Thu, 13 Mar 2003 22:45:26 +0100


F> I wonder if someone knows how to test a variables data type. e.g. if
F> <dtml-var a> is integer or string.

IIRC python scripts have a special function : same_type(var1, var2)
if same_type(a, 'any string'):
   return "string !!"

python's normal way , type(a) is restricted for security reasons i
believe, but you can always do it in an external method if you really
need it..

   

--
Geir Bækholt