Leandro Ardissone wrote:
> Hi,
>
> I want to know what type is a variable.
> For example, I get the contents of an xml but some content is a list or
> a string, and I need to know what type it is.

You should try to treat it as a list, catch the exceptions raise when
it is a string (problably ValueError, TypeError ou Attribute error,
depends on what are you doing), and then treat it as a string. This is
the BAFP (better ask for forgiveness than permission) style, and is
more accepted in duck-typing languages like Python then LBYL (look
before you leep) style.

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

Reply via email to