__init__ explanation please

Colin J. Williams cjw at sympatico.ca
Sat Jan 12 19:58:18 EST 2008


Erik Lind wrote:
> I'm new to Python, and OOP. I've read most of Mark Lutz's book and more 
> online and can write simple modules, but I still don't get when __init__ 
> needs to be used as opposed to creating a class instance by assignment. For 
> some strange reason the literature seems to take this for granted. I'd 
> appreciate any pointers or links that can help clarify this.
> 
> Thanks
> 
> 
You don't always need __init__ if 
__new__ is used with a "new" class.

Colin W.




More information about the Python-list mailing list