Ron Adam wrote:
> Does anyone have suggestions on how to improve this further?

Not functionally (from me, yet). However if you can bear a stylistic
comment, do read on :-)

>          elif (isinstance(object,str)
>                  or isinstance(object,int)
>                  or isinstance(object,bool)
>                  or isinstance(object,tuple)
>                  or isinstance(object,list)
>                  or isinstance(object,dict)):

Since Python version 2.2, the 2nd arg of isinstance may be a tuple. You
could define this up front, with a meaningful name:

TYPES_WHICH_whatever = (str, int, bool, etc etc)

Cheers,
John

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to