Opened 10 years ago

Closed 4 years ago

#10622 closed enhancement (fixed)

import sage.all.* into the interact library

Reported by: jason Owned by: itolkov, jason
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: interact Keywords:
Cc: mhampton Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by chapoton)

This patch:

diff -r 553928e53141 sage/interacts/library.py
--- a/sage/interacts/library.py Mon Jan 10 10:03:25 2011 +0100
+++ b/sage/interacts/library.py Thu Jan 13 09:01:40 2011 -0800
@@ -3,9 +3,9 @@
 """
 
 from sagenb.notebook.interact import interact, slider, range_slider, input_box
-from sage.all import sin, plot, point, html, show, latex, SR,exp
-x=SR.var('x')
-
+from sage.all import *
+x=var('x')
+       
 from sage.misc.decorators import sage_wraps
 from sage.misc.html import html
 

makes it *much* easier to move interacts to the library since you don't have to define every single thing you use from the sage library.

Change History (10)

comment:1 Changed 10 years ago by jason

  • Status changed from new to needs_work

I'm a little surprised that there aren't circular import problems here, so this should definitely be tested. If it works, it's a big win for making interacts easier to port to the library.

Marshall, can you test this and turn it into a real patch?

comment:2 Changed 10 years ago by mhampton

I'll try to fold this into #9623 and test the result. It would be cool if it works. I tried to add that import to the decorator but couldn't get it to work.

comment:3 Changed 10 years ago by mhampton

This seems to work remarkably well. I will refactor #9623 accordingly. I would like to do these together to avoid merge annoyances.

comment:4 Changed 10 years ago by jason

Yes, I hit a limitation in Python when I tried to import * in the decorator. A quick search led to several emails by Guido et. al. in 2001 about this being a problem or something.

Anyways, import * at the module namespace works. It just means that people better not try to tab-complete on interacts.library.<tab>, since it will give the entire Sage namespace, I believe!

comment:5 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:6 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:7 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:8 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:9 Changed 6 years ago by chapoton

  • Description modified (diff)

comment:10 Changed 4 years ago by jdemeyer

  • Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
  • Resolution set to fixed
  • Status changed from needs_work to closed
Note: See TracTickets for help on using tickets.