Ticket #10800: trac_10800_sequence_hash_error_typo_rebased.patch

File trac_10800_sequence_hash_error_typo_rebased.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 1299577338 -28800
    # Node ID 2215d61af81009427d7d6fec69e456f8bfcadc17
    # Parent  60dae5ef827eca5f8f076ccf79abf34b840e2cde
    Trac 10800: fix typo in error when hashing mutable sequence
    
    diff -r 60dae5ef827e -r 2215d61af810 sage/structure/sequence.py
    a b  
    250250    if universe is None:
    251251        if not isinstance(x, (list, tuple)):
    252252            x = list(x)
    253             #raise TypeError, "x must be a list or tuple"
     253            #raise TypeError("x must be a list or tuple")
    254254
    255255        if len(x) == 0:
    256256            import sage.categories.all
     
    686686            sage: a.__hash__()
    687687            Traceback (most recent call last):
    688688            ...
    689             ValueError: immutable sequences are unhashable
     689            ValueError: mutable sequences are unhashable
    690690            sage: a[0] = 10
    691691            sage: a.set_immutable()
    692692            sage: a.__hash__()
     
    697697            -5823618793256324351  # 64-bit
    698698        """
    699699        if not self._is_immutable:
    700             raise ValueError, "immutable sequences are unhashable"
     700            raise ValueError("mutable sequences are unhashable")
    701701        if self.__hash is None:
    702702            self.__hash = hash(tuple(self))
    703703        return self.__hash
     
    797797            ValueError: object is immutable; please change a copy instead.
    798798        """
    799799        if self._is_immutable:
    800             raise ValueError, "object is immutable; please change a copy instead."%self
     800            raise ValueError("object is immutable; please change a copy instead.")
    801801
    802802    def set_immutable(self):
    803803        """