Skip to content

Commit 4813c2e

Browse files
Last __getitem__ example
Class name and attribute correction
1 parent 3cf1eec commit 4813c2e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

classes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ Implementing **getitem** in a class allows its instances to use the []
200200
def __getitem__(self,i):
201201
return self.info[i]
202202
203-
foo = OldClass()
204-
foo['title']
203+
foo = GetTest()
204+
foo['name']
205205
# Output: 'Yasoob'
206206
207207
foo['number']

0 commit comments

Comments
 (0)