Ticket #13904: trac13904_use_del.patch

File trac13904_use_del.patch, 833 bytes (added by SimonKing, 8 years ago)

Use del rather then calling __delitem__ directly, in TripleDict and MonoDict

  • sage/structure/coerce_dict.pyx

    # HG changeset patch
    # User Simon King <simon.king@uni-jena.de>
    # Date 1358762802 -3600
    # Node ID 46e16a74a6fa148ae6953669825ebacc6bde9cf7
    # Parent  05ebba10dfe1b8f2f93cdfe7a522986e0ae00a33
    #13904: Use del when deleting items from MonoDict and TripleDict
    
    diff --git a/sage/structure/coerce_dict.pyx b/sage/structure/coerce_dict.pyx
    a b  
    131131                D._size -= 1
    132132                break
    133133        try:
    134             D._refcache.__delitem__(k)
     134            del D._refcache[k]
    135135        except KeyError:
    136136            pass
    137137
     
    229229                D._size -= 1
    230230                break
    231231        try:
    232             D._refcache.__delitem__((k1,k2,k3))
     232            del D._refcache[k1,k2,k3]
    233233        except KeyError:
    234234            pass
    235235