Opened 13 months ago

Last modified 10 months ago

#25522 needs_review enhancement

IPython cell magic %%no_preparse that disables the Sage preparser

Reported by: gh-bryangingechen Owned by:
Priority: minor Milestone: sage-8.4
Component: user interface Keywords: ipython magic
Cc: nbruin Merged in:
Authors: Bryan Gin-ge Chen Reviewers:
Report Upstream: N/A Work issues:
Branch: u/gh-bryangingechen/nopreparse (Commits) Commit: b231bca998b28232cb13e0310fa1d899cb2a74a0
Dependencies: Stopgaps:

Description

I'm opening this ticket because of nbruin's suggestion for my answer https://ask.sagemath.org/question/9277/preparser-state-for-regexs/?answer=42530#post-id-42530

There I shared code for an IPython extension which registers a cell magic which disables the Sage preparser (by toggling the state of the global variable sage.repl.interpreter._do_preparse before and after running the cell).

Change History (7)

comment:1 Changed 13 months ago by gh-bryangingechen

Before I create a branch, I'd like to get feedback on the following:

Does the name %%noparse work, or should I change it to something else?

I was thinking of adding the magic to the end of the class SageMagics? in sage/repl/ipython_extension.py . Any objections?

Anything else for a first-time contributor to keep in mind?

comment:2 Changed 11 months ago by gh-bryangingechen

  • Branch set to u/gh-bryangingechen/nopreparse
  • Commit set to 773be9ef2fc37d717f011ad66110db795881e3ec
  • Status changed from new to needs_review

I decided to use the name %%nopreparse instead.


New commits:

773be9eAdd %%nopreparse cell magic

comment:3 Changed 11 months ago by git

  • Commit changed from 773be9ef2fc37d717f011ad66110db795881e3ec to 3f959f448aa7173b2caee45ad19a4c4f75875b11

Branch pushed to git repo; I updated commit sha1. New commits:

3f959f4Rename to no_preparse

comment:4 Changed 11 months ago by git

  • Commit changed from 3f959f448aa7173b2caee45ad19a4c4f75875b11 to b231bca998b28232cb13e0310fa1d899cb2a74a0

Branch pushed to git repo; I updated commit sha1. New commits:

b231bcaremove trailing whitespace

comment:5 Changed 11 months ago by gh-bryangingechen

  • Summary changed from ipython cell magic to disable preparser to IPython cell magic %%no_preparse that disables the Sage preparser

no_preparse seems to be more in line with the accepted Python code style.

comment:6 Changed 11 months ago by gh-bryangingechen

  • Authors changed from gh-bryangingechen to Bryan Gin-ge Chen

comment:7 Changed 10 months ago by gh-bryangingechen

  • Component changed from notebook to user interface
  • Keywords ipython magic added
  • Milestone changed from sage-8.3 to sage-8.4

patchbot failures seem unrelated

Note: See TracTickets for help on using tickets.