How to detect what type a variable is?

Leandro Ardissone lardissone at gmail.com
Wed Nov 29 11:26:51 EST 2006


Thanks,

I don't store Python objects in xml, but I get an object from a library
that parses xml and converts it to objects.


On Nov 29, 12:43 pm, Neil Cerutti <horp... at yahoo.com> wrote:
> On 2006-11-29, Grant Edwards <gra... at visi.com> wrote:
>
> > On 2006-11-29, Leandro Ardissone <lardiss... at gmail.com> wrote:
>
> >> 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.
>
> >>>> x = 'asdf'
> >>>> type(x)
> ><type 'str'>
> >>>> i = 0
> >>>> type(i)
> ><type 'int'>That makes me wonder how he manages to store Python objects in
> xml.
> 
> --
> Neil Cerutti




More information about the Python-list mailing list