How to control the creation of an instance?

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Sun Jun 3 08:50:13 CEST 2007


On Sat, 02 Jun 2007 23:25:49 -0700, 7stud wrote:

> Oops.  This line:
> 
>> temp = object.__new__(Sample, args, kwds)
> 
> should be:
> 
> temp = object.__new__(cls, args, kwds)
> 
> although it would seem that cls is always going to be Sample, so I'm
> not sure what practical difference that makes.

What if you are calling it from a sub-class?


-- 
Steven.




More information about the Python-list mailing list