[Tfug] Python

Chris Niswander MOST.SENDERS.ARE._FILTERED.OUT_--FOR.MY.REAL.EMAIL.ADDRESS.check.my.website..tfug.rcvr.x6a3 at bitboost.com
Wed Jun 10 14:34:07 MST 2009


cara wrote:

> I remain bitter. My former boss forced me to use python ZSI for a Web 
> Service client. It was terrible.  Python's dynamic typing couldn't tell 
> if something was a string or an array. The code it generated made 
> looking at legacy perl scripts a joy.
> 

If you are writing real Python code *yourself*,
it's easy to distinguish a string from a Python 'list',
which is the usual Python equivalent of a Perl array.
(You can distinguish a Python array too,
but I'm guessing that's not what you meant.)

     import types

     if isinstance(somevalue, types.StringTypes):
         # It's a string...
     elif isinstance(somevalue, types.ListType):
         # It's a list...
     else:
         # I did not expect this!

But I'll interpret your complaint as a possible warning
about Python ZSI, which I don't think is part of the normal
Python language or standard libraries.





More information about the tfug mailing list