Ticket #9958: trac_9958-fix-list_index.patch

File trac_9958-fix-list_index.patch, 1.4 KB (added by fbissey, 10 years ago)

fix the element reported by list index

  • sage/sets/finite_set_map_cy.pyx

    # HG changeset patch
    # User Francois Bissey <francois.bissey@canterbury.ac.nz>
    # Date 1303957653 -43200
    # Node ID 782a2d778ea9443d6019bc8892774e3e93a1080c
    # Parent  767af29c56c0476219fff2eaae7aadcc8616b53d
    #9958 fixing list index
    
    diff --git a/sage/sets/finite_set_map_cy.pyx b/sage/sets/finite_set_map_cy.pyx
    a b  
    491491            ...       fs3.setimage("z", 2)
    492492            Traceback (most recent call last):
    493493            ...
    494             ValueError: list.index(x): x not in list
     494            ValueError: 'z' is not in list
    495495
    496496            sage: with fs.clone() as fs3:
    497497            ...       fs3.setimage(1, 4)
    498498            Traceback (most recent call last):
    499499            ...
    500             ValueError: list.index(x): x not in list
     500            ValueError: 1 is not in list
    501501        """
    502502        parent = self._parent
    503503        return self._setitem(parent._rank_domain(i), parent._rank_codomain(j))
  • sage/structure/list_clone.pyx

    diff --git a/sage/structure/list_clone.pyx b/sage/structure/list_clone.pyx
    a b  
    719719            sage: c.index(5)
    720720            Traceback (most recent call last):
    721721            ...
    722             ValueError: list.index(x): x not in list
     722            ValueError: 5 is not in list
    723723        """
    724724        if start is None:
    725725            return self._list.index(x)