Opened 12 years ago

Last modified 8 years ago

## #11223 new defect

# Ipython magic commands don't get preparsed

Reported by: | Maarten Derickx | Owned by: | William Stein |
---|---|---|---|

Priority: | major | Milestone: | sage-6.4 |

Component: | user interface | Keywords: | |

Cc: | Merged in: | ||

Authors: | Reviewers: | ||

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

the following was posted in http://groups.google.com/group/sage-devel/browse_thread/thread/209cb82fd378946b/b7122bbf9c893928#b7122bbf9c893928

One problem, these things don't seem to be preparsed.

---------------------------------------------------------------------- | Sage Version 4.6.2, Release Date: 2011-02-25 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- sage: %bg factor(next_prime(10^30)*next_prime(10^40)) Starting job # 0 in a separate thread. sage: jobs.status() Completed jobs: 0 : factor(next_prime(10^30)*next_prime(10^40)) sage: jobs[0].result 23 * 37

because

Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> 10^30 20 >>> 10^40 34

### Change History (8)

### comment:1 Changed 12 years ago by

### comment:3 Changed 10 years ago by

After applying the patches at #12719, I see

sage: %bg factor(next_prime(10^30)*next_prime(10^40)) ERROR: Line magic function `%bg` not found.

So I guess it is "fixed" in one sense, but not very satisfactorily.

### comment:4 Changed 10 years ago by

Ah, good point. In fact, I think %bg isn't implemented yet in IPython. It's on the list of things to do by IPython developers.

### comment:5 Changed 9 years ago by

Milestone: | sage-5.11 → sage-5.12 |
---|

### comment:6 Changed 9 years ago by

Milestone: | sage-6.1 → sage-6.2 |
---|

### comment:7 Changed 9 years ago by

Milestone: | sage-6.2 → sage-6.3 |
---|

### comment:8 Changed 8 years ago by

Milestone: | sage-6.3 → sage-6.4 |
---|

**Note:**See TracTickets for help on using tickets.

This could probably be fixed by overwriting eiter the input_prefilter() or pre_runcode_hook() as described on http://ipython.scipy.org/doc/stable/html/api/generated/IPython.hooks.html#IPython.hooks.shell_hook