#9652: Unnecesary and buggy code in arith.py
------------------------+---------------------------------------------------
   Reporter:  mderickx  |       Owner:  AlexGhitza  
       Type:  defect    |      Status:  needs_review
   Priority:  minor     |   Milestone:              
  Component:  algebra   |    Keywords:              
     Author:            |    Upstream:  N/A         
   Reviewer:            |      Merged:              
Work_issues:            |  
------------------------+---------------------------------------------------
Changes (by mderickx):

  * status:  needs_work => needs_review


Comment:

 I added a second patch which takes most of the comments into account.
 (please only apply the second patch, it got added as a second patch since
 I forgot to check the "replace existing file" box).

 I didn't do anything with the "For the main code, why not !do:" suggestion
 since to me it seemed to do the same thing but then with a different
 coding style. (My version is the "look before you leap version", and yours
 the "Easier to ask for forgiveness than permission."). If there are
 reasons to chose one above the other I would certainly do that. I know
 that my code will raise an attribute error sometimes, an error that you
 would rewrite in your case. But I guess that error should be not confusing
 at all to the enduser.

 {{{

 sage: valuation(graphs.!PetersenGraph())

 ---------------------------------------------------------------------------

 !AttributeError                            Traceback (most recent call
 last)

 /Users/maarten/<ipython console> in <module>()

 /Applications/sage/local/lib/python2.6/site-packages/sage/rings/arith.pyc
 in valuation(m, *args1, **args2)

     600     if isinstance(m,(int,long)):

     601         m=Integer(m)

 --> 602     return m.valuation(*args1, **args2)

     603

     604 def prime_powers(start, stop=None):

 !AttributeError: 'Graph' object has no attribute 'valuation'

 sage:

 }}}

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