Class warfare...

Warren Focke wfocke at phoenixdsl.com
Fri Sep 15 20:23:05 EDT 2000


Alex Martelli:
> class Bucket():
>     def __init__(self, cnt=0):
>         self.cnt = cnt
> 
> b = apply(Bucket, (0,2,0,7,0))

I hope you meant map, not apply.

And, as I neglected to point out before, the parentheses in the class
statement are verboten if the inheritance list is empty.  The language
reference implies that they are optional, but the interpreter does not
agree.  As of CPython 1.5.2 or JPython 1.1, anyway; I haven't tried any
of that newfangled stuff yet.

Warren Focke
-- 
Just because romance and rapture have so often served as a pretext for
curdled banality doesn't make the sentiments themselves obsolete.
 -- Michelle Goldberg



More information about the Python-list mailing list