Closed
Description
We use %psource in notebooks to refer to code, and that is good. But the code is displayed in a popup window, and one drawback is that you can only display one function at a time this way. Another drawback is that the code doesn't scroll with the rst of the document (this can sometimes be an advantage, sometimes a drawback).
I propose to add to utils the following function, and prefer to use it over %psource:
import inspect
def psource(*functions):
"Print the source code for the given function(s)."
print('\n\n'.join(inspect.getsource(fn) for fn in functions))
Metadata
Metadata
Assignees
Labels
No labels