structs in python

Paul Rubin phr-n2002b at NOSPAMnightsong.com
Sun Jul 7 02:30:25 EDT 2002


"Sean 'Shaleh' Perry" <shalehperry at attbi.com> writes:
> However this breaks down for your delta = ... example.
> 
> is
> 
> class Point:
>   def __init__(x, y, color):
>     self.x = x
>     self.y = y
>     self.color = color
> 
> really that much to type?

Yes, it seems clumsy to me.  See how error prone it is: your __init__
function arg list forgot to mention 'self'.

The new slots scheme may be better but it doesn't exist in older
Pythons and isn't well documented in 2.2.



More information about the Python-list mailing list