On 01/08/12 15:28, rail shafigulin wrote:
I'm trying to understand how to use the two methods. I know that __new__
is used to create an object, while __init__ to initialize. But I'm not
sure what happens when I create an object.
Use print statements to find out...
>>> class C(object):
...
On Wed, Aug 1, 2012 at 11:10 AM, Hugo Arts wrote:
> On Wed, Aug 1, 2012 at 4:28 PM, rail shafigulin
>
> * small caveat: I'm entirely unsure of this, but I *think* if you create
> CarModel with a metaclass that overrides __call__ you can change the way
> __new__ and __init__ work? If anyone can co
On 02/08/12 01:10, Hugo Arts wrote:
* small caveat: I'm entirely unsure of this, but I *think* if you create
CarModel with a metaclass that overrides __call__ you can change the way
__new__ and __init__ work? If anyone can confirm this, be my guest.
Correct. Metaclasses can essentially change
On 02/08/12 00:28, rail shafigulin wrote:
Hello everyone.
I'm trying to understand how to use the two methods. I know that __new__ is
used to create an object, while __init__ to initialize. But I'm not sure
what happens when I create an object.
I found the following code in the book (Python 3 O
On Wed, Aug 1, 2012 at 4:28 PM, rail shafigulin
wrote:
> Hello everyone.
>
> I'm trying to understand how to use the two methods. I know that __new__
> is used to create an object, while __init__ to initialize. But I'm not sure
> what happens when I create an object.
>
> I found the following code
Hello everyone.
I'm trying to understand how to use the two methods. I know that __new__ is
used to create an object, while __init__ to initialize. But I'm not sure
what happens when I create an object.
I found the following code in the book (Python 3 Object Oriented
Programming by Dusty Phillips