#19385: Refactor DiGraph.__init__
-------------------------+-------------------------------------------------
Reporter: | Owner:
ncohen | Status: needs_review
Type: | Milestone: sage-6.9
enhancement | Resolution:
Priority: major | Merged in:
Component: graph | Reviewers:
theory | Work issues:
Keywords: | Commit:
Authors: | cf53613abb473f53411b50bd2ddc049050cd6dbc
Nathann Cohen | Stopgaps:
Report Upstream: N/A |
Branch: |
u/ncohen/19385 |
Dependencies: |
#19381 |
-------------------------+-------------------------------------------------
Comment (by tscrim):
Working it down a little more. With this branch:
{{{
sage: Q = DiGraph({1:{2:['a','c']}, 2:{3:['b']}}, immutable=True,
weighted=True)
sage: Q.weighted()
True
sage: hash(Q)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
<ipython-input-15-9389487dfecf> in <module>()
----> 1 hash(Q)
/home/travis/sage/src/sage/misc/cachefunc.pyx in
sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__
(/home/travis/sage/src/build/cythonized/sage/misc/cachefunc.c:14346)()
2213 if self.cache is None:
2214 f = self.f
-> 2215 self.cache = f(self._instance)
2216 return self.cache
2217
/home/travis/sage/local/lib/python2.7/site-
packages/sage/graphs/generic_graph.pyc in __hash__(self)
579 return hash((frozenset(self.vertex_iterator()),
580 self._weighted,
--> 581 frozenset(edge_items)))
582 raise TypeError("This graph is mutable, and thus not
hashable. "
583 "Create an immutable copy by
`g.copy(immutable=True)`")
TypeError: unhashable type: 'list'
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/19385#comment:7>
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.