#10800: typo in Sequence
-----------------------------+----------------------------------------------
Reporter: dsm | Owner: tbd
Type: defect | Status: new
Priority: trivial | Milestone:
Component: PLEASE CHANGE | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Description changed by dsm:
Old description:
> If you try to hash a mutable sequence, Sage complains that immutable
> sequences are unhashable..
>
> {{{
> sage: hash(a)
> ---------------------------------------------------------------------------
> ValueError Traceback (most recent call
> last)
>
> /Applications/sage_devel/<ipython console> in <module>()
>
> /Applications/sage/local/lib/python2.6/site-
> packages/sage/structure/sequence.pyc in __hash__(self)
> 517 """
> 518 if not self._is_immutable:
> --> 519 raise ValueError, "immutable sequences are
> unhashable"
> 520 if self.__hash is None:
> 521 self.__hash = hash(tuple(self))
>
> ValueError: immutable sequences are unhashable
> }}}
>
> which is backwards; immutable sequences are the only ones that are
> hashable.
New description:
If you try to hash a mutable sequence, Sage complains that immutable
sequences are unhashable..
{{{
sage: a = Sequence([1,2,3])
sage: hash(a)
---------------------------------------------------------------------------
ValueError Traceback (most recent call
last)
/Applications/sage_devel/<ipython console> in <module>()
/Applications/sage/local/lib/python2.6/site-
packages/sage/structure/sequence.pyc in __hash__(self)
517 """
518 if not self._is_immutable:
--> 519 raise ValueError, "immutable sequences are unhashable"
520 if self.__hash is None:
521 self.__hash = hash(tuple(self))
ValueError: immutable sequences are unhashable
}}}
which is backwards; immutable sequences are the only ones that are
hashable.
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10800#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.