# HG changeset patch
# User Maarten Derickx <m.derickx.student@gmail.com>
# Date 1301006818 25200
# Node ID 9d6814f3693c1b435fc71f9af8c5d465a80f2ced
# Parent c942aaac1d2b41ec8df8c677a6c56628aab971b0
#10548 add doctests to make sure ticket is fixed
* * *
#10570 reduce the ammount of stackframes alive at startup
diff git a/sage/all.py b/sage/all.py
a

b


1  1  """ 
2  2  all.py  much of sage is imported into this module, so you don't 
3  3  have to import everything individually. 
 4  
 5  TESTS: 
 6  
 7  This is to test #10570. If the number of stackframes at startup 
 8  changes due to a patch you made, please check that this was an 
 9  intended effect of your patch. 
 10  
 11  :: 
 12  
 13  sage: import gc 
 14  sage: import inspect 
 15  sage: from sage import * 
 16  sage: frames=[x for x in gc.get_objects() if inspect.isframe(x)] 
 17  sage: len(frames) 
 18  11 
 19  
4  20  """ 
5  21  
6  22  from __future__ import with_statement 
diff git a/sage/modular/modsym/modsym.py b/sage/modular/modsym/modsym.py
a

b


155  155  sage: sage.modular.modsym.modsym.ModularSymbols_clear_cache() 
156  156  sage: sage.modular.modsym.modsym._cache.keys() 
157  157  [] 
 158  
 159  TESTS: 
 160  
 161  Make sure #10548 is fixed 
 162  sage: import gc 
 163  sage: m=ModularSymbols(Gamma1(29)) 
 164  sage: m=[] 
 165  sage: ModularSymbols_clear_cache() 
 166  sage: gc.collect() # random 
 167  3422 
 168  sage: a=[x for x in gc.get_objects() if isinstance(x,sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_g1)] 
 169  sage: a 
 170  [] 
 171  
158  172  """ 
159  173  global _cache 
160  174  _cache = {} 