#4710: [with patch, positive review] fix docstring for divisors
---------------------------------+------------------------
Reporter: robertwb | Owner: tba
Type: defect | Status: closed
Priority: major | Milestone: sage-3.4
Component: documentation | Resolution: fixed
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
---------------------------------+------------------------
Changes (by chapoton):
* upstream: => N/A
Old description:
> {{{
> On Dec 4, 2008, at 9:35 PM, pong wrote:
>
> In SAGE 3.2.1 , the docstring of divisors says:
>
> Definition: divisors(n)
> Docstring:
>
> Returns a list of all positive integer divisors
> of the nonzero integer n.
>
> A second parameter may be passed to surpress sorting
> of the list (as ordering the list can be more time
> consuming then creating it).
>
> INPUT:
> n -- the element
> sorted -- whether or not to sort the output (default True)
>
> My question is how to get an unsorted output?
>
> I tried divisors(300, sorted=False) but SAGE complaints that divisors
> only takes 1 argument. In fact, the source codes seem to suggest that
> it will always return a sorted list.
> }}}
>
> Now the divisors are always returned sorted (as we have resolved the
> issue of sorting taking the majority of the time). The documentation
> needs to be fixed.
New description:
{{{
On Dec 4, 2008, at 9:35 PM, pong wrote:
In SAGE 3.2.1 , the docstring of divisors says:
Definition: divisors(n)
Docstring:
Returns a list of all positive integer divisors
of the nonzero integer n.
A second parameter may be passed to surpress sorting
of the list (as ordering the list can be more time
consuming then creating it).
INPUT:
n -- the element
sorted -- whether or not to sort the output (default True)
My question is how to get an unsorted output?
I tried divisors(300, sorted=False) but SAGE complaints that divisors
only takes 1 argument. In fact, the source codes seem to suggest that
it will always return a sorted list.
}}}
Now the divisors are always returned sorted (as we have resolved the issue
of sorting taking the majority of the time). The documentation needs to be
fixed.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/4710#comment:4>
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.