This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Jurko.Gospodnetić
Recipients Jurko.Gospodnetić, docs@python, eryksun, steven.daprano
Date 2014-05-03.09:11:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1399108273.26.0.566337008237.issue21415@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the detailed response! :-(

I should have tested more before reporting the issue.
Sorry for the noise. :-(

I saw the 'cls' argument and assumed it was a class
method. Having to explicitly specify cls did not
seem to be in contradiction with this since I assumed
__new__ is generally invoked on the class directly.

I still do not see why it had to be a static method
and has not been implemented as a class method, but I
guess I'll better ask that kind of a question on the
python user's newsgroup. :-)

Just in case it can help someone else, here's some
sample code what convinced me __new__ was indeed
implemented as a static method:

> class X:
>     pass
> X.__new__()   # TypeError: object.__new__(): not enough arguments
> X.__new__(X)  # creates a new X instance
> x = X()
> x.__new__()   # TypeError: object.__new__(): not enough arguments
> x.__new__(X)  # creates a new X instance

If __new__ had been a class method then calling
'x.__new__()' would have worked as well.

Thanks again for the replies!

Best regards,
  Jurko Gospodnetić
History
Date User Action Args
2014-05-03 09:11:13Jurko.Gospodnetićsetrecipients: + Jurko.Gospodnetić, steven.daprano, docs@python, eryksun
2014-05-03 09:11:13Jurko.Gospodnetićsetmessageid: <1399108273.26.0.566337008237.issue21415@psf.upfronthosting.co.za>
2014-05-03 09:11:13Jurko.Gospodnetićlinkissue21415 messages
2014-05-03 09:11:12Jurko.Gospodnetićcreate