-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code_prettify does not recognize IPython magic commands #1018
Comments
This happens because It could be possible to preprocess the text from code cells to remove the magics (while leaving an anchor) and reinsert the magics after reformatting (but clearly this is not at my top todo). if somebody wants to give it a try, welcome! |
I've looked at this before & recall concluding that the necessary preprocessing would have to be done by the relevant kernel. The ipython kernel does this line-by-line, but I couldn't find a simple way to separate the preprocessing from the execution, iirc. |
[code_prettify] added support for IPython magics, cf #1018
@jfbercher Thank you very much! |
E.g., using
%%time
raises the following error, which is probably straight from PyYapf:Not sure if you feel this is a code_prettify issue or a yapf issue.
The text was updated successfully, but these errors were encountered: