| 54 | A_GLOBAL_VALUE = 123 |
| 55 | |
| 56 | class Squares: |
| 57 | |
| 58 | def __init__(self, max): |
| 59 | self.max = max |
| 60 | self.sofar = [] |
| 61 | |
| 62 | def __len__(self): return len(self.sofar) |
| 63 | |
| 64 | def __getitem__(self, i): |
| 65 | if not 0 <= i < self.max: raise IndexError |
| 66 | n = len(self.sofar) |
| 67 | while n <= i: |
| 68 | self.sofar.append(n*n) |
| 69 | n += 1 |
| 70 | return self.sofar[i] |
| 71 | |
| 72 | class StrSquares: |
| 73 |
no outgoing calls
searching dependent graphs…