Why Use str on a doc string? : Doc String « Development « Python






Why Use str on a doc string?

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.

           
         
  








Related examples in the same category

1.Document string
2.api helper: Print methods and doc stringsapi helper: Print methods and doc strings
3.Sample Use of api helper for listSample Use of api helper for list
4.Cheap and simple API helper
5.Specify Documentation Strings during function definitionSpecify Documentation Strings during function definition