Pickle, __init__, and classes

Peter Hansen peter at engcorp.com
Tue Aug 2 17:21:00 EDT 2005


Russell Blau wrote:
> Try __new__().  http://docs.python.org/ref/customization.html  This isn't
> the usual application of __new__, but since it returns an object it should
> be ideal for your purposes.

Or simply create a factory function to return your instances -- which is 
in effect what __new__ does -- but without the baggage.

-Peter



More information about the Python-list mailing list