#17489: remove redundant factorial() from rings/arith.py
-------------------------------------+-------------------------------------
Reporter: rws | Owner:
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.5
Component: symbolics | Resolution:
Keywords: | Merged in:
Authors: Ralf Stephan | Reviewers: Jeroen Demeyer
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/rws/remove_redundant_factorial___from_rings_arith_py|
3b54c755b2da09d40872276d0d95d941ddcdea66
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by jdemeyer):
* status: needs_review => needs_work
Comment:
This is overly complicated:
{{{
try:
x_in_ZZ = ZZ(x)
coercion_success = True
except TypeError:
coercion_success = False
if coercion_success and x_in_ZZ >= 0:
return ZZ(x).factorial()
else:
return py_tgamma(x+1)
}}}
Why not
{{{
try:
x = ZZ(x)
except TypeError:
pass
else:
if x >= 0:
return x.factorial()
return py_tgamma(x+1)
}}}
Also: the {{{:trac:`9240`}}} syntax should be used in docstrings, not
comments in code, so please revert that.
--
Ticket URL: <http://trac.sagemath.org/ticket/17489#comment:16>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.