Steven D'Aprano schrieb am 14.07.2015 um 06:54:
> On Tuesday 14 July 2015 14:45, Ben Finney wrote:
>> The Python reference says of a class ‘__new__’ method::
>>
>> object.__new__(cls[, ...])
>>
>> Called to create a new instance of class cls. __new__() is a static
>> method (special-cas
Steven D'Aprano writes:
> py> class Spam(object):
> ... def __new__(cls):
> ... print cls
> ...
> py> Spam.__new__() # implicit first arg?
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: __new__() takes exactly 1 argument (0 given)
Thanks, I'm glad I
On Tuesday 14 July 2015 14:45, Ben Finney wrote:
> Howdy all,
>
> The Python reference says of a class ‘__new__’ method::
>
> object.__new__(cls[, ...])
>
> Called to create a new instance of class cls. __new__() is a static
> method (special-cased so you need not declare it as such
Howdy all,
The Python reference says of a class ‘__new__’ method::
object.__new__(cls[, ...])
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 i