On Tue, 6 Jun 2017 at 11:20 Peter Otten <__pete...@web.de> wrote:

>
> >>> import os
> >>> inspect.getsourcefile(os.path.split)
> '/usr/lib/python3.4/posixpath.py'
>
> And so much more fun than scanning the documentation :)
>

Alternatively, without using inspect, we can get around `Object.__module__`
being a string by importing it as a string:

>>> import importlib, os
>>> importlib.import_module(os.path.split.__module__).__file__
'/Users/matt/.pyenv/versions/3.6.0/lib/python3.6/posixpath.py'
-- 

--
Matt Wheeler
http://funkyh.at
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to