G
George Marshall
Hi, I'm wondering, what's the best way to check for
success or failure on object initialization ?
This is my ugly workaround to do that :
class mytest:
status=0
def __init__ (self):
status=1
_mytest = mytest()
def mytest ():
if everythingok():
return _mytest()
else:
return None
def everythingok():
return False
def main():
a=mytest()
if a==None:
return 1
if __name__ == "__main__"
main()
What's the python way to do that ?
Thanks.
success or failure on object initialization ?
This is my ugly workaround to do that :
class mytest:
status=0
def __init__ (self):
status=1
_mytest = mytest()
def mytest ():
if everythingok():
return _mytest()
else:
return None
def everythingok():
return False
def main():
a=mytest()
if a==None:
return 1
if __name__ == "__main__"
main()
What's the python way to do that ?
Thanks.