Back to index

python3.2  3.2.2
Classes | Functions | Variables
find_recursionlimit Namespace Reference

Classes

class  RecursiveBlowup1
class  RecursiveBlowup2
class  RecursiveBlowup4
class  RecursiveBlowup5
class  RecursiveBlowup6

Functions

def test_init
def test_repr
def test_add
def test_getattr
def test_getitem
def test_recurse
def test_cpickle
def check_limit

Variables

int limit = 1000

Function Documentation

def find_recursionlimit.check_limit (   n,
  test_func_name 
)

Definition at line 92 of file find_recursionlimit.py.

00092 
00093 def check_limit(n, test_func_name):
00094     sys.setrecursionlimit(n)
00095     if test_func_name.startswith("test_"):
00096         print(test_func_name[5:])
00097     else:
00098         print(test_func_name)
00099     test_func = globals()[test_func_name]
00100     try:
00101         test_func()
00102     # AttributeError can be raised because of the way e.g. PyDict_GetItem()
00103     # silences all exceptions and returns NULL, which is usually interpreted
00104     # as "missing attribute".
00105     except (RuntimeError, AttributeError):
00106         pass
00107     else:
00108         print("Yikes!")

Here is the call graph for this function:

Definition at line 53 of file find_recursionlimit.py.

00053 
00054 def test_add():
00055     return RecursiveBlowup4() + RecursiveBlowup4()

def find_recursionlimit.test_cpickle (   _cache = {})

Definition at line 73 of file find_recursionlimit.py.

00073 
00074 def test_cpickle(_cache={}):
00075     import io
00076     try:
00077         import _pickle
00078     except ImportError:
00079         print("cannot import _pickle, skipped!")
00080         return
00081     k, l = None, None
00082     for n in itertools.count():
00083         try:
00084             l = _cache[n]
00085             continue  # Already tried and it works, let's save some time
00086         except KeyError:
00087             for i in range(100):
00088                 l = [k, l]
00089                 k = {i: l}
00090         _pickle.Pickler(io.BytesIO(), protocol=-1).dump(l)
00091         _cache[n] = l

Here is the call graph for this function:

Definition at line 60 of file find_recursionlimit.py.

00060 
00061 def test_getattr():
00062     return RecursiveBlowup5().attr

Definition at line 67 of file find_recursionlimit.py.

00067 
00068 def test_getitem():
00069     return RecursiveBlowup6()[5]

Definition at line 39 of file find_recursionlimit.py.

00039 
00040 def test_init():
00041     return RecursiveBlowup1()

Definition at line 70 of file find_recursionlimit.py.

00070 
00071 def test_recurse():
00072     return test_recurse()

Definition at line 46 of file find_recursionlimit.py.

00046 
00047 def test_repr():
00048     return repr(RecursiveBlowup2())


Variable Documentation

Definition at line 109 of file find_recursionlimit.py.