Foo.__new__ is what species of method?
ben+python at benfinney.id.au
Tue Jul 14 06:45:25 CEST 2015
The Python reference says of a class ‘__new__’ method::
Called to create a new instance of class cls. __new__() is a static
method (special-cased so you need not declare it as such) that takes
the class of which an instance was requested as its first argument.
But a “static method” is described, elsewhere in the documentation
“A static method does not receive an implicit first argument”.
What the ‘__new__’ documentation describes would match a “class method”
“A class method receives the class as implicit first argument”.
I suspect this a bug in the reference documentation for ‘__new__’, and
it should instead say “__new__ is a class method …”. Am I wrong?
\ “Cooles & Heates: If you want just condition of warm in your |
`\ room, please control yourself.” —air conditioner instructions, |
_o__) Japan |
More information about the Python-list