Class warfare...
Erik Max Francis
max at alcyone.com
Fri Sep 15 20:31:27 EDT 2000
Alex Martelli wrote:
> There are several ways, but the one I would suggest is:
>
> class Bucket():
^ syntax error; you meant class Bucket:
> def __init__(self, cnt=0):
> self.cnt = cnt
>
> b = apply(Bucket, (0,2,0,7,0))
This last line is equivalent to
b = Bucket(0, 2, 0, 7, 0)
which isn't what you meant. I suspect you meant:
b = map(Bucket, [0, 2, 0, 7, 0]) # second argument can also be tuple
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ Of all the perversions, chastity is the strangest.
\__/ Anatole France
blackgirl international / http://www.blackgirl.org/
The Internet resource for black women.
More information about the Python-list
mailing list