Opened 8 years ago

Closed 8 years ago

#14169 closed defect (duplicate)

Let %attach behave like the old attach, and provide a doctest for %attach

Reported by: SimonKing Owned by: was
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: user interface Keywords:
Cc: Merged in:
Authors: Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Currently (sage-5.8.beta0), when using attach /path/to/file.pyx, one gets a deprecation warning and is told to use %attach instead of attach.

Problem: If one changes the file that is attached with %attach then no automatic re-compilation happens. But that would be the main point of attaching a file! And the automatic re-compilation used to be a feature of attach. Hence, changing from attach to %attach is a regression.

Moreover, it seems that %attach is not doc-tested.

Not clear if "user interface" is the right component, but attach is used in interactive sessions, after all...

Change History (7)

comment:1 Changed 8 years ago by kcrisman

This is presumably due to #12719. Note that you can still use attach('foo.spyx'), apparently, without receiving the warning.

Would an acceptable solution be to change the deprecation warning to say that if you want the magic function, you will be using IPython's native attach, and if you want the recompiling, you can use Sage's version? I admit that doesn't sound appetizing to me, just brainstorming.

comment:2 Changed 8 years ago by kcrisman

See also #14149.

comment:3 Changed 8 years ago by hthomas

The behaviour I am getting (using 5.9.beta1) is a little different than what was described originally. Suppose I attach a file using %attach. If I edit the file and hit return at the sage prompt, my file is not recompiled. But when I next enter anything non-trivial at the sage prompt (eg, 1+1), the file is recompiled.

So the behaviour is different from the old behaviour, and a bit surprising, but not entirely broken. That said, I still prefer the old behaviour.

Last edited 8 years ago by hthomas (previous) (diff)

comment:4 Changed 8 years ago by hthomas

It turns out this phenomenon was discussed at when ipython was upgraded to 0.13. Apparently it wouldn't be so easy to change. But it should work as I described in my comment; if it doesn't that's definitely a bug.

comment:5 Changed 8 years ago by hthomas

  • Milestone changed from sage-5.10 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

This behaviour is being changed at #14523, which also includes doctests. I think this ticket can be closed.

comment:6 Changed 8 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

I concur.

comment:7 Changed 8 years ago by jdemeyer

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.