What arguments are passed to the __new__ method ?

Peter Pearson pkpearson at nowhere.invalid
Wed Mar 2 12:40:17 EST 2016


On Tue, 1 Mar 2016 18:24:12 +0100, ast wrote:
>
> It's not clear to me what arguments are passed to the
> __new__ method. Here is a piece of code:
>
>
> class Premiere:
>
>     def __new__(cls, price):
>          return object.__new__(cls)
>
>     def __init__(self, price):
>             pass
[snip]

Of course, maybe you don't need to define a __new__ method at all.
Personally, I find that __init__ suffices for my simple needs.

-- 
To email me, substitute nowhere->runbox, invalid->com.



More information about the Python-list mailing list