Q:

Is there any way of returning method documentation strings?

As dir() method in python3 returns all the available usable methods,
is there any methods for returning documentation(explanation) of the method as string?
In case of pop() method of dictionary it should be returning the following:

class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT])
@overload def pop Possible types:
• (self: MutableMapping, k: _KT) -> _VT
• (self: MutableMapping, k: _KT, default: Union[_VT, _T]) -> Union[_VT, _T]
External documentation:
http://docs.python.org/3.6/library/

A:

You can access the docstring of a function using the __doc__ attribute:
➜ python
Python 3.6.4 (default, May 23 2018, 17:30:17)
Type "help", "copyright", "credits" or "license" for more information.
>>> print(dict.pop.__doc__)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised

