tobiah wrote:
> Suppose I do:
> 
> 
> myfoo = Foo('grapes', 'oranges')
> 
> And in the __init__() of Foo, there is
> a real problem with the consumption of fruit.
> Is there a clean way to ensure that myfoo
> will be None after the call?  Would the
> __init__() just do del(self), or is there
> a better way to think about this?

There is a way, of course, that results in myfoo
being None in case of an error, but it is not a one-liner and
I'd not recommend it.
If something goes wrong, raising an exception is the best thing to do.

Georg
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to