__init__ is the initialiser

Ethan Furman ethan at stoneleaf.us
Fri Jan 31 15:57:32 EST 2014


On 01/31/2014 12:48 PM, MRAB wrote:
> On 2014-01-31 19:52, Ned Batchelder wrote:
>>
>> Why can't we call __init__ the constructor and __new__ the allocator?
>
> The advantage of calling it the "initialiser" is that it explains why
> it's called "__init__".

Hm, yes, good point.  Also, __init__ initializes so it is a good choice.   Ignore the names comment in my previous post.

--
~Ethan~



More information about the Python-list mailing list