#12977: Let singular_function expect "attributes" not as a dict
---------------------------------------+------------------------------------
       Reporter:  SimonKing            |         Owner:  malb        
           Type:  defect               |        Status:  needs_review
       Priority:  major                |     Milestone:  sage-5.1    
      Component:  commutative algebra  |    Resolution:              
       Keywords:  sd40.5               |   Work issues:              
Report Upstream:  N/A                  |     Reviewers:  Mike Hansen 
        Authors:  Simon King           |     Merged in:              
   Dependencies:                       |      Stopgaps:              
---------------------------------------+------------------------------------

Comment (by robertwb):

 Replying to [comment:10 SimonKing]:
 > Replying to [comment:9 robertwb]:
 > > a_attrib will be defined after any non-empty loop even if it doesn't
 break with a match
 >
 > I don't understand that comment. a_attrib is used only in the few lines
 that I changed. And what loop are you talking about? The outer loop `for a
 in args:` (line 559)? But a_attrib is set to None at each round of the
 outer loop: See the new line 630.

 {{{
         634                         for a_,a_attrib in attributes:
         635                             if a_ is a:
         636                                 break
 }}}

 If the {{{a_ is a}}} clause is never executed, the loop will run to
 completion and {{{a_attrib}}} will have the value {{{attributes[-1][1]}}}
 unless attributes happens to be empty.

 > > I think that this interface is rather subtle, I'd rather have a
 compare_using_identiy=[True|False] keyword in the function (which will
 iterate over the dictionary rather than indexing into it).
 >
 > One could argue that by using the dictionary (i.e., the old syntax) you
 declare that you want comparison by equality rather than identity.

 But this is equivalently subtle, I'd never guess that in seeing the two
 versions. In any case it's certainly not

 {{{
 sage: import this
 The Zen of Python, by Tim Peters
 ...
 Explicit is better than implicit.
 }}}

 Are you against having an explicit flag?

 > And also note that in Singular you assign an attribute to an individual
 ideal; hence, I find it wrong that in Sage we assign the attributes to an
 equivalence class of ideal.

 I'm with you here, but that's orthogonal.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12977#comment:12>
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