#20499: Graphs: docstring of _add_ conflicts with function
-------------------------------------+-------------------------------------
Reporter: jmantysalo | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-7.2
Component: graph theory | Resolution:
Keywords: | Merged in:
Authors: Jori Mäntysalo | Reviewers: David Coudert
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jmantysalo/graphs__docstring_of__add__conflicts_with_function|
44e539e9c85793a3cfefaa8929a370ef28da5789
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by dcoudert):
The error message is confusing since the order of types is the reverse of
the one used in the operation.
{{{
+ sage: G+42
+ Traceback (most recent call last):
+ ...
+ TypeError: adding a <type 'sage.rings.integer.Integer'> to a
<class 'sage.graphs.graph.Graph'> is not defined
}}}
I was not aware of the problem with immutable graphs. So ok to assign
directly to `G._name`.
However, you should replace `G._name = '%s disjoint_union %s'%(a, b)` with
`G._name = '{} disjoint_union {}'.format(a, b)`.
Some people are actively working on making sage python3 compliant. No need
to add extra work.
--
Ticket URL: <http://trac.sagemath.org/ticket/20499#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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.