Opened 9 years ago
Closed 6 years ago
#12446 closed defect (fixed)
Introduce user_globals
Reported by:  schilly  Owned by:  was 

Priority:  major  Milestone:  sage6.6 
Component:  user interface  Keywords:  
Cc:  Merged in:  
Authors:  Jeroen Demeyer  Reviewers:  Volker Braun 
Report Upstream:  N/A  Work issues:  
Branch:  704007e (Commits, GitHub, GitLab)  Commit:  704007ea5b0b4bf145ad5acae3e5fd4749d83c0b 
Dependencies:  Stopgaps: 
Description (last modified by )
We introduce a new feature: user globals. The idea is to store somewhere a dictionary with the userspace globals which can then be used to inject global variables.
This ticket implements the framework for this and fixes this bug in cython_lambda
as proofofconcept:
sage: a = 25 sage: f = cython_lambda('double x', 'sage.math.sin(x) + sage.a') sage: f(10) # known bug 24.455978889110629 sage: a = 50 sage: f(10) # known bug 49.455978889110632
Executing this gives
sage: a = 25 sage: f = cython_lambda('double x', 'sage.math.sin(x) + sage.a') sage: f(10) Traceback (most recent call last): ... KeyError: 'math'
Change History (15)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
comment:3 Changed 8 years ago by
 Component changed from misc to cython
 Owner changed from jason to jdemeyer
comment:4 Changed 8 years ago by
 Milestone changed from sage5.11 to sage5.12
comment:5 Changed 7 years ago by
 Milestone changed from sage6.1 to sage6.2
comment:6 Changed 7 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:7 Changed 7 years ago by
 Milestone changed from sage6.3 to sage6.4
comment:8 Changed 7 years ago by
 Description modified (diff)
comment:9 Changed 6 years ago by
 Component changed from cython to user interface
 Description modified (diff)
 Milestone changed from sage6.4 to sage6.6
 Owner changed from jdemeyer to was
 Priority changed from minor to major
 Summary changed from sage access in cython_lambda broken to Introduce user_globals
comment:10 Changed 6 years ago by
 Branch set to u/jdemeyer/sage_access_in_cython_lambda_broken
comment:11 Changed 6 years ago by
 Commit set to b5b2726fd61bb2955a02838f3b298864f882e158
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
b5b2726  Introduce user_globals

comment:12 Changed 6 years ago by
 Status changed from new to needs_review
comment:13 Changed 6 years ago by
 Commit changed from b5b2726fd61bb2955a02838f3b298864f882e158 to 704007ea5b0b4bf145ad5acae3e5fd4749d83c0b
Branch pushed to git repo; I updated commit sha1. New commits:
704007e  Make it an error to use user_globals with initialization

comment:14 Changed 6 years ago by
 Reviewers set to Volker Braun
 Status changed from needs_review to positive_review
comment:15 Changed 6 years ago by
 Branch changed from u/jdemeyer/sage_access_in_cython_lambda_broken to 704007ea5b0b4bf145ad5acae3e5fd4749d83c0b
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
This is Mac OS X 10.7.4, I actually get a couple other errors.