Returning 'None' on Instantiation ?
Dave.Haynes at sia-mce.co.uk
Fri Jun 1 15:28:11 CEST 2001
Is there a way to optionally return 'None' on instantiation? I'm
thinking of something like the following:
def __init__(self, param):
if <check param>:
<initialise data members>
<make self a 'None object'>
myParam = GetParam()
myObj = myClass(myParam)
print 'Couldn't make myObj from myParam'
This is a fairly common state of affairs. If there's nothing specific
in Python to accomodate this, what methods are considered robust by
More information about the Python-list