Newbie help - test for data type

Bruno Desthuilliers onurb at xiludom.gro
Mon Jul 31 05:46:04 EDT 2006


Dennis Benzinger wrote:
> Jonathan Bowlas wrote:
>> Hi Listers,
>>
>> I have a requirement to test for a data type could someone tell me if
>> this
>> is possible in python?
>>
>> Basically I have a ZPT in Zope that users can select checkboxes in a form
>> which pass arguments for a python function, however if there is only one
>> checkbox selected it is passed as a string whereas more than one
>> checkbox is
>> passed as a list. Therefore if my function is required to perform an
>> action
>> based on each argument passed in the list the function works correctly
>> but
>> if it is passed as a string nothing happens.
> 
> You need the isinstance() function. 

Not in Zope.


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list