#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):
{{{
sage: hash(Q.copy(immutable=True))
8019503473919971649
sage: hash(Q.copy(immutable=True, weighted=True))
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
<ipython-input-4-dab47b1641ed> in <module>()
----> 1 hash(Q.copy(immutable=True, weighted=True))
/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)
576 if self.allows_multiple_edges():
577 from collections import Counter
--> 578 edge_items = Counter(edge_items).items()
579 return hash((frozenset(self.vertex_iterator()),
580 self._weighted,
/home/travis/sage/local/lib/python/collections.pyc in __init__(self,
iterable, **kwds)
451 '''
452 super(Counter, self).__init__()
--> 453 self.update(iterable, **kwds)
454
455 def __missing__(self, key):
/home/travis/sage/local/lib/python/collections.pyc in update(self,
iterable, **kwds)
533 self_get = self.get
534 for elem in iterable:
--> 535 self[elem] = self_get(elem, 0) + 1
536 if kwds:
537 self.update(kwds)
TypeError: unhashable type: 'list'
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/19385#comment:5>
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.