Back to index

python3.2  3.2.2
Classes | Functions
test.test_funcattrs Namespace Reference

Classes

class  FuncAttrsTest
class  FunctionPropertiesTest
class  InstancemethodAttrTest
class  ArbitraryFunctionAttrTest
class  FunctionDictsTest
class  FunctionDocstringTest
class  CellTest
class  StaticMethodAttrsTest

Functions

def cell
def empty_cell
def test_main

Function Documentation

def test.test_funcattrs.cell (   value)
Create a cell containing the given value.

Definition at line 274 of file test_funcattrs.py.

00274 
00275 def cell(value):
00276     """Create a cell containing the given value."""
00277     def f():
00278         print(a)
00279     a = value
00280     return f.__closure__[0]

Here is the caller graph for this function:

def test.test_funcattrs.empty_cell (   empty = True)
Create an empty cell.

Definition at line 281 of file test_funcattrs.py.

00281 
00282 def empty_cell(empty=True):
00283     """Create an empty cell."""
00284     def f():
00285         print(a)
00286     # the intent of the following line is simply "if False:";  it's
00287     # spelt this way to avoid the danger that a future optimization
00288     # might simply remove an "if False:" code block.
00289     if not empty:
00290         a = 1729
00291     return f.__closure__[0]
00292 

Here is the caller graph for this function:

Definition at line 318 of file test_funcattrs.py.

00318 
00319 def test_main():
00320     support.run_unittest(FunctionPropertiesTest, InstancemethodAttrTest,
00321                               ArbitraryFunctionAttrTest, FunctionDictsTest,
00322                               FunctionDocstringTest, CellTest,
00323                               StaticMethodAttrsTest)