Tim Hoffman wrote: > Hi > > I must be stupid or something, but I can't for the life > of me work out a simple way of determining if a variable contains > a string or array, in a PythonScript in Zope. > > I can't import type and or use type() function. > isinstance doesn't work because I can't give a type as the second arg.
Python scripts provide a special function, "same_type()", for this purpose. Example: if same_type(s, ''): s = [s] Shane _______________________________________________ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )