IPython shows decorator docstring instead of function docstring
We recently implemented the verbose option using a decorator. I just noticed that IPython now shows the decorator docstring instead of the function docstring, e.g, mne.minimum_norm.apply_inverse?? shows the docstring of verbose().
This seems to be a problem with IPython but it would be good if we can find a way to fix it before the release.
The problem only happens when ?? is used (show the code), just ? works fine.
did you try to google it?
Yes, using functools.wraps handles the docstring but IPython gets the wrong source when ?? is used, see ipython/ipython#1555
Thanks for catching and redirecting this, I should have opened an issue instead of just sending thoughts to the list ;-)
(for clarification: I sent a mail with about the same content but without PR or issue yesterday, presumably you will have missed and this was based on an independent observation...) Anyways, excellent, this was quite annoying.
good.. I was wondering what you were talking about ;-)
Arrgh, it was too self evident to me, then after one minute or so I realize what I wrote was somewhat ambiguous. Sorry for the confusion. LOL
On Tue, Dec 4, 2012 at 9:14 PM, Martin Luessi [email protected]:
good.. I was wondering what you were talking about ;-)
— Reply to this email directly or view it on GitHubhttps://github.com/mne-tools/mne-python/issues/215#issuecomment-11013736.
The argument list still shows the generic (_args, *_kwargs) from the decorator..Though the doctring tends to have enough information, it would be nice to see the original list of arguments from the function to know which parameters are the kwargs, and which are positional args and what the defaults may be. Is that something easily achieved?