MCPcopy Create free account
hub / github.com/dabeaz-course/python-mastery / __getitem__

Method __getitem__

Solutions/2_5/readrides.py:109–113  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

107 self.numrides.append(d['rides'])
108
109 def __getitem__(self, index):
110 return { 'route': self.routes[index],
111 'date': self.dates[index],
112 'daytype': self.daytypes[index],
113 'rides': self.numrides[index] }
114
115# Modified version using RideData
116def read_rides_as_dicts(filename):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected