making a class return None from __init__

Max M maxm at mxm.dk
Fri Oct 4 22:46:11 CEST 2002


Rajarshi Guha wrote:

> (where v will fail) I always get <__main__.Graph instance at 0xXXXXXX>
> Is there any way to make the constructor return a None object?


def noner():
     return

print noner()

 >>> None


regards Max M

The reason I don't reach any higher is that I stand on the shoulders of 
little people.




More information about the Python-list mailing list