Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_builtin.Squares Class Reference

List of all members.

Public Member Functions

def __init__
def __len__
def __getitem__

Public Attributes

 max
 sofar

Detailed Description

Definition at line 17 of file test_builtin.py.


Constructor & Destructor Documentation

def test.test_builtin.Squares.__init__ (   self,
  max 
)

Definition at line 19 of file test_builtin.py.

00019 
00020     def __init__(self, max):
00021         self.max = max
00022         self.sofar = []

Here is the caller graph for this function:


Member Function Documentation

def test.test_builtin.Squares.__getitem__ (   self,
  i 
)

Definition at line 25 of file test_builtin.py.

00025 
00026     def __getitem__(self, i):
00027         if not 0 <= i < self.max: raise IndexError
00028         n = len(self.sofar)
00029         while n <= i:
00030             self.sofar.append(n*n)
00031             n += 1
00032         return self.sofar[i]

Definition at line 23 of file test_builtin.py.

00023 
00024     def __len__(self): return len(self.sofar)


Member Data Documentation

Definition at line 20 of file test_builtin.py.

Definition at line 21 of file test_builtin.py.


The documentation for this class was generated from the following file: