#8323: The variable "name" is predefined in Sage
---------------------------+------------------------------------------------
   Reporter:  roed         |       Owner:  tbd         
       Type:  defect       |      Status:  needs_review
   Priority:  trivial      |   Milestone:              
  Component:  misc         |    Keywords:              
     Author:  Craig Citro  |    Upstream:  N/A         
   Reviewer:               |      Merged:              
Work_issues:               |  
---------------------------+------------------------------------------------
Changes (by newvalueoldvalue):

  * status:  new => needs_review
  * author:  => Craig Citro


Comment:

 It's coming from near line 150 in `sage/all.py`:

 {{{
 #Deprecate the is_* functions from the top level
 #All of these functions should be removed from the top level
 #after a few releases, and this code should be removed.
 #--Mike Hansen 9/25/2008
 globs = globals()
 from functools import wraps, partial
 for name,func in globs.items():
 }}}

 ... but then `name` and `func` are never deleted. (Ahh, scoping in
 Python.) Sure enough, `func` is defined, too:

 {{{
 sage: func
 <function KodairaSymbol at 0x10940daa0>
 }}}

 So I'm attaching an obvious patch -- there might be something classier,
 but this works. (And yes, this is still necessary in Py3.)

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8323#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to