Back to index

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

List of all members.

Public Member Functions

def __init__
def __len__
def __getitem__

Public Attributes

 max
 sofar

Detailed Description

Definition at line 33 of file test_builtin.py.


Constructor & Destructor Documentation

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

Definition at line 35 of file test_builtin.py.

00035 
00036     def __init__(self, max):
00037         self.max = max
00038         self.sofar = []

Here is the caller graph for this function:


Member Function Documentation

Definition at line 42 of file test_builtin.py.

00042 
00043     def __getitem__(self, i):
00044         if not 0 <= i < self.max:
00045             raise IndexError
00046         n = len(self.sofar)
00047         while n <= i:
00048             self.sofar.append(str(n*n))
00049             n += 1
00050         return self.sofar[i]

Definition at line 39 of file test_builtin.py.

00039 
00040     def __len__(self):
00041         return len(self.sofar)


Member Data Documentation

Definition at line 36 of file test_builtin.py.

Definition at line 37 of file test_builtin.py.


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