Ticket #10800: trac_10800_sequence_hash_error_typo.patch

File trac_10800_sequence_hash_error_typo.patch, 1.7 KB (added by D.S. McNeil, 12 years ago)
  • sage/structure/sequence.py

    # HG changeset patch
    # User D. S. McNeil <dsm054@gmail.com>
    # Date 1299486104 -28800
    # Node ID 9d3565584e6306fa40d38827fbd82767363a469d
    # Parent  8438b7c20d79c02a2ece3e1c3f7224a772ff8f07
    Trac 10800: fix typo in error when hashing sequence
    
    diff -r 8438b7c20d79 -r 9d3565584e63 sage/structure/sequence.py
    a b  
    269269        """
    270270        if not isinstance(x, (list, tuple)):
    271271            x = list(x)
    272             #raise TypeError, "x must be a list or tuple"
     272            #raise TypeError("x must be a list or tuple")
    273273        self.__hash = None
    274274
    275275       
     
    505505            sage: a.__hash__()
    506506            Traceback (most recent call last):
    507507            ...
    508             ValueError: immutable sequences are unhashable
     508            ValueError: mutable sequences are unhashable
    509509            sage: a[0] = 10
    510510            sage: a.set_immutable()
    511511            sage: a.__hash__()
     
    516516            -5823618793256324351  # 64-bit
    517517        """
    518518        if not self._is_immutable:
    519             raise ValueError, "immutable sequences are unhashable"
     519            raise ValueError("mutable sequences are unhashable")
    520520        if self.__hash is None:
    521521            self.__hash = hash(tuple(self))
    522522        return self.__hash
     
    616616            ValueError: object is immutable; please change a copy instead.
    617617        """
    618618        if self._is_immutable:
    619             raise ValueError, "object is immutable; please change a copy instead."%self
     619            raise ValueError("object is immutable; please change a copy instead.")
    620620
    621621    def set_immutable(self):
    622622        """