structs in python

Erik Max Francis max at alcyone.com
Sun Jul 7 00:30:19 EDT 2002


Kevin O'Connor wrote:

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

This kind of thing is why you have slots.  Check the documentation for
the __slots__ class attribute.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ See the son in your bad day / Smell the flowers in the valley
\__/ Chante Moore
    Bosskey.net: Aliens vs. Predator 2 / http://www.bosskey.net/avp2/
 A personal guide to Aliens vs. Predator 2.



More information about the Python-list mailing list