Create Data Type
Guyon Morée
gumuz at looze.net
Mon Feb 3 18:37:47 EST 2003
hehe, and still... i think you should use a class, piece of cake really :)
just use an empty 'dummie-class' as a container like this:
>>> class MyStruct: pass
...
>>> foo = MyStruct()
>>> foo.datafield1 = "some data"
>>> foo.datafield2 = 1232134
>>> foo.datafield3 = [1,2,3,4,"a","b","c"]
>>> foo.datafield1
'some data'
"Wezzy" <Fabio at est.it> wrote in message
news:dCC%9.13321$YL4.103511 at tornado.fastwebnet.it...
> Hi i'm a newbie. I have a simple question : does Python support the
creation
> of user-defined data types ? i don't need a class, just a simple struct
> like C struct.
>
> Bye
> Wezzy
More information about the Python-list
mailing list