Mega Code Archive

 
Categories / Python / Development
 

Why Use str on a doc string

def foo(): print 2  foo()  print foo.__doc__   foo.__doc__ == None print str(foo.__doc__) # The str function takes the null value and returns a string representation of it,  #can use either == None or is None, but is None is faster.