Add this to your .bashrc:
pysource() {
$EDITOR $(python -c "import ${1}; import inspect; print inspect.getsourcefile(${1})")
}
Your favorite editor should pop up and you can browse the module source. If you want to open a module from an existing editor window, there’s probably plugins for that.
Then after reloading your .bashrc just run something like:
$ pysource logging