Python 使用 __doc__ 查看文档

前言:今天在读《流畅的 Python 》时,突然遇到了 map() 函数,我不认识。之前都是直接谷歌的,今天突然怔了一下,为啥不用 __doc__ 查看文档呢?

遂实践之。

print(map.__doc__)

输出:

map(func, *iterables) --> map object

Make an iterator that computes the function using arguments from
each of the iterables.  Stops when the shortest iterable is exhausted.

也可以直接用控制台,我这里用的是 ipython:

20210220163320

原文地址:https://www.cnblogs.com/fanlumaster/p/14421963.html