#8766: document the _iadd_ and _imul_ special integer.pyx methods, which mutate
self
--------------------------------+-------------------------------------------
Reporter: was | Owner: AlexGhitza
Type: defect | Status: new
Priority: major | Milestone: sage-4.4.1
Component: basic arithmetic | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------+-------------------------------------------
Description changed by was:
Old description:
> I looked in integer.pyx at the two methods _iadd_ and _imul_, which both
> mutate self, e.g., allow for:
> {{{
> sage: a = 2010
> sage: a._imul_(19)
> sage: a
> 38190
> }}}
> I expected to find a bug exciting docstring about how these methods are
> unsafe, etc. Instead, there is *NOTHING* -- not even a doctest or
> docstring at all.
New description:
I looked in integer.pyx at the two methods _iadd_ and _imul_, which both
mutate self, e.g., allow for:
{{{
sage: a = 2010
sage: a._imul_(19)
sage: a
38190
}}}
I expected to find a bug exciting docstring about how these methods are
unsafe, etc. Instead, there is *NOTHING* -- not even a doctest or
docstring at all.
I also wish there were versions of these:
{{{
sage: a.unsafe_add_inplace
sage: a.unsafe_mul_inplace
}}}
that could be used in code, and would make their unsafe nature clear to
the reader without having to read any docs.
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8766#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.