Ticket #1042: trac1042.patch

File trac1042.patch, 1.1 KB (added by was, 14 years ago)

fixed by Mike Hansen and I.

  • sage/misc/reset.pyx

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1194123698 25200
    # Node ID 98b51d1541054e976f16d173ab2c6e43f5fa0488
    # Parent  dfb8ea49d39e40f7e2350bd3ae611214d6f289da
    # Parent  157c82ec0a548ad68edef2118865ad371f4c81d6
    Mike Hansen and my joint fix for trac #1042 -- reset() doesn't restore anything in all_cmdline or all_notebook
    
    diff -r dfb8ea49d39e -r 98b51d154105 sage/misc/reset.pyx
    a b def reset(vars=None): 
    1212    INPUT:
    1313        vars -- (default: None), a list, or space or comma separated
    1414        string.
     15
     16    EXAMPLES:
     17        sage: x = 5
     18        sage: reset()
     19        sage: x
     20        x
    1521    """
    1622    if not vars is None:
    1723        restore(vars)
    def reset(vars=None): 
    1925    G = globals()  # this is the reason the code must be in SageX.
    2026    T = type(sys)
    2127    for k in G.keys():
    22         if k[0] != '_' and type(k) != T:
     28        if k[0] != '_' and type(k) != T and k != 'sage_mode':
    2329            try:
    2430                del G[k]
    2531            except KeyError: