__init__ concerns

Peter Wang pzw1 at hotmail.com
Tue Dec 11 09:44:47 EST 2001


"Alex Martelli" <aleax at aleax.it> wrote in message news:<9v4ov301ukq at enews4.newsguy.com>...
> have to stick with it if you're stuck on Python 1.5.2.  In modern
> Python,
> 
>     def __init__(self, *args, **kwds):
>         BASECLASS.__init__(self, *args, **kwds)
>         # whatever else you need here
> 
> is a very typical idiom, and I don't see any "kind of a kludge" are
> about it (and, of course, variations were args and/or kwds are tweaked
> somehow before delegating to a base class's __init__).

ah, i was not aware that python 2.0 had this particular construct. 
i'll have to go back and read the ChangeLogs.  :)  you're right, the
new notation is not a kludge at all, and i was actually a bit
disappointed that this was not the behavior in 1.5.2.  (the old style
of using apply() seemed a bit... uncouth.)

thanks to everyone who replied!

-peter



More information about the Python-list mailing list