Skip to content
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

import sage.all.* into the interact library #10622

Closed
jasongrout opened this issue Jan 13, 2011 · 5 comments
Closed

import sage.all.* into the interact library #10622

jasongrout opened this issue Jan 13, 2011 · 5 comments

Comments

@jasongrout
Copy link
Member

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.

CC: @sagetrac-mhampton

Component: interact

Issue created by migration from https://trac.sagemath.org/ticket/10622

@jasongrout
Copy link
Member Author

comment:1

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?

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 13, 2011

comment:2

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.

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 13, 2011

comment:3

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

@jasongrout
Copy link
Member Author

comment:4

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., since it will give the entire Sage namespace, I believe!

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@fchapoton

This comment has been minimized.

@jdemeyer jdemeyer removed this from the sage-6.4 milestone Mar 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants