[Tutor] method, type?
Cameron Simpson
cs at zip.com.au
Thu Jan 7 20:02:44 EST 2016
On 08Jan2016 00:18, ALAN GAULD <alan.gauld at btinternet.com> wrote:
>My only point of difference here, I think, is the definition
>of a constructor. I consider a constructor to be the creator
>of object instances, which makes the only default Python
>constructor the __new__() since the __init__() is only an
>initializer.
Me too. I was deliberately avoiding the term "constructor", then let myself get
sucked into using it just now because you get a new instance of your target
class out of the factory function/method. But they are better thought of as
wrappers for the class' real constructor.
For this sloppiness, my apologies,
Cameron Simpson <cs at zip.com.au>
More information about the Tutor
mailing list