Re: Modify arguments between __new__ and __init__

2007-12-23 Thread Steven D'Aprano
On Sat, 22 Dec 2007 23:01:50 -0700, Steven Bethard wrote: > Steven D'Aprano wrote: >> When you call a new-style class, the __new__ method is called with the >> user-supplied arguments, followed by the __init__ method with the same >> arguments. >> >> I would like to modify the arguments after the

Re: Modify arguments between __new__ and __init__

2007-12-23 Thread Arnaud Delobelle
On Dec 23, 5:03 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > When you call a new-style class, the __new__ method is called with the > user-supplied arguments, followed by the __init__ method with the same > arguments. > > I would like to modify the arguments after the __new__

Re: Modify arguments between __new__ and __init__

2007-12-22 Thread Steven Bethard
Steven D'Aprano wrote: > When you call a new-style class, the __new__ method is called with the > user-supplied arguments, followed by the __init__ method with the same > arguments. > > I would like to modify the arguments after the __new__ method is called > but before the __init__ method, som

Re: Modify arguments between __new__ and __init__

2007-12-22 Thread [EMAIL PROTECTED]
On Dec 22, 11:03 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > When you call a new-style class, the __new__ method is called with the > user-supplied arguments, followed by the __init__ method with the same > arguments. > Only if __new__ returns an object of the type passed i

Modify arguments between __new__ and __init__

2007-12-22 Thread Steven D'Aprano
When you call a new-style class, the __new__ method is called with the user-supplied arguments, followed by the __init__ method with the same arguments. I would like to modify the arguments after the __new__ method is called but before the __init__ method, somewhat like this: >>> class Spam(o