文档字符串可以在运行时访问,也可以用来自动生成文档。

输入:

def foo():
    print "This is a doc string"
    return True

foo()

运行结果:

This is a doc string

 

相关文章: