Does inspect.getsourceline
do what you are after?
>>> import inspect
>>> from pathlib import PosixPath
>>>> inspect.getsourcelines(PosixPath)[1]
1538
>>>> inspect.getsourcelines(PosixPath.glob)[1]
1121
CLICK HERE to find out more related problems solutions.