Ticket #12616: trac_12616_reviewer.patch

File trac_12616_reviewer.patch, 1.3 KB (added by SimonKing, 9 years ago)
  • sage/numerical/mip.pyx

    # HG changeset patch
    # User Simon King <simon.king@uni-jena.de>
    # Date 1331295476 -3600
    # Node ID 07bd6823d40ce70df11302d5faa3c563b2e2a15a
    # Parent  c1dfa5b3ab1fef08b449e81fd8c7d54ee41a85a3
    #12616: Reviewer patch
    
    diff --git a/sage/numerical/mip.pyx b/sage/numerical/mip.pyx
    a b  
    204204
    205205        TESTS:
    206206
    207         Checks the objects are deallocated (cf. :trac:`12616`)::
     207        Checks that the objects are deallocated without invoking the cyclic garbage
     208        collector (cf. :trac:`12616`)::
    208209
    209210            sage: del p
    210211            sage: def just_create_variables():
     
    217218            sage: _ = gc.collect()  # avoid side effects of other doc tests
    218219            sage: len([x for x in gc.get_objects() if isinstance(x,C)])
    219220            0
     221
     222        We now disable the cyclic garbage collector. Since :trac:`12616` avoids
     223        a reference cycle, the mixed integer linear program created in
     224        ``just_create_variables()`` is removed even without the cyclic garbage
     225        collection::
     226
     227            sage: gc.disable()
    220228            sage: just_create_variables()
    221229            sage: len([x for x in gc.get_objects() if isinstance(x,C)])
    222230            0
     231            sage: gc.enable()
    223232        """
    224233
    225234        from sage.numerical.backends.generic_backend import get_solver