Ticket #14159: trac_12313-revert_callback_from_11521.patch

File trac_12313-revert_callback_from_11521.patch, 1015 bytes (added by nbruin, 7 years ago)

patch that got misplaced on #12313

  • sage/categories/homset.py

    # HG changeset patch
    # User Simon King <simon.king@uni-jena.de>
    # Date 1361657992 -3600
    # Node ID 6cb381abd5dd50a5588baa4bd32b71a8ee57a72d
    # Parent  d17092d0c427fb874889fd251636ceda8707dbb8
    #14159: Revert the use of a KeyedReference for homsets introduced in #11521
    
    diff --git a/sage/categories/homset.py b/sage/categories/homset.py
    a b  
    7575# Use the weak "triple" dictionary
    7676# introduced in trac ticket #715
    7777
    78 from weakref import KeyedRef
     78from weakref import ref
    7979from sage.structure.coerce_dict import TripleDict
    8080_cache = TripleDict(53)
    8181
     
    262262    # of Homset in rings, schemes, ...
    263263    H = category.hom_category().parent_class(X, Y, category = category)
    264264           
    265     ##_cache[key] = weakref.ref(H)
    266     _cache[key] = KeyedRef(H, _cache.eraser, (id(X),id(Y),id(category)))
     265    _cache[key] = ref(H)
     266    ##_cache[key] = KeyedRef(H, _cache.eraser, (id(X),id(Y),id(category)))
    267267    return H
    268268
    269269def hom(X, Y, f):