Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #65155

Re: __init__ is the initialiser

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: __init__ is the initialiser
Date 2014-02-01 00:51 +0000
References <lcgtpf$tui$1@ger.gmane.org> <lcgut2$b8r$1@ger.gmane.org> <858utviwgs.fsf@benfinney.id.au> <lchce7$44q$1@ger.gmane.org> <52EC3C40.7080402@stoneleaf.us>
Newsgroups comp.lang.python
Message-ID <mailman.6235.1391215880.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 01/02/2014 00:13, Ethan Furman wrote:
> On 01/31/2014 03:43 PM, Ned Batchelder wrote:
>> On 1/31/14 6:05 PM, Ben Finney wrote:
>>> Ned Batchelder writes:
>>
>> I'm not hoping to change any official terminology. I just think that
>> calling __init__ anything other than a constructor
>> is confusing pedantry.  It is a constructor, and Python constructors
>> work differently than those in C++ and Java.
>
> And I would say the opposite.  __init__ is not creating anything, which
> is what I think of when speaking of a constructor.  I'd be willing to
> yield the point that Python has a pair of methods that make up the
> constructor (an allocator and an initializer), but I found calling
> __init__ the constructor very confusing.
>
> --
> ~Ethan~

Here's what help says.

Python 3.4.0b2 (v3.4.0b2:ba32913eb13e, Jan  5 2014, 16:23:43) [MSC 
v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> help(object.__new__)
Help on built-in function __new__:

__new__(...)
     T.__new__(S, ...) -> a new object with type S, a subtype of T

 >>> help(object.__init__)
Help on wrapper_descriptor:

__init__(...)
     x.__init__(...) initializes x; see help(type(x)) for signature

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: __init__ is the initialiser Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-01 00:51 +0000

csiph-web