Why Use str on a doc string? : Doc String : Development PYTHON examples


PYTHON examples » Development » Doc String »

 

Why Use str on a doc string?


Why Use str on a doc string?
 


def foo(): print 

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.

           
         
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Development
» Doc String


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0