structs in python

Christopher A. Craig list-python at ccraig.org
Mon Jul 8 01:22:21 EDT 2002


"Kevin O'Connor" <kevin at koconnor.net> writes:

> What if a syntax like the following were permitted:
> >>> p = ( .x = 10, .y = 11, .color = 'blue')
> >>> print p.x
> 10
> >>>

Why don't you just use a dict?  

>>> p = {'x'=10, 'y'=11, 'color'=blue}
>>> print p['x']
10
>>>



-- 
Christopher A. Craig <list-python at ccraig.org>
"Going to school make a person educated, any more than going to a 
garage makes a person a car" Slashdot





More information about the Python-list mailing list