Skip to content

Commit c079eb9

Browse files
committed
fix: Correct reference to Sequence
1 parent 393db77 commit c079eb9

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

Exercises/ex2_5.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function.
175175

176176
import collections
177177
...
178-
class RideData(collections.Sequence):
178+
class RideData(collections.abc.Sequence):
179179
def __init__(self):
180180
self.routes = [] # Columns
181181
self.dates = []
@@ -204,7 +204,7 @@ into 4 separate `append()` operations.
204204
# readrides.py
205205
...
206206

207-
class RideData(collections.Sequence):
207+
class RideData(collections.abc.Sequence):
208208
def __init__(self):
209209
# Each value is a list with all of the values (a column)
210210
self.routes = []

Exercises/soln2_5.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def read_rides_as_columns(filename):
9393
# The great "fake"
9494

9595
import collections
96-
class RideData(collections.Sequence):
96+
class RideData(collections.abc.Sequence):
9797
def __init__(self):
9898
# Each value is a list with all of the values (a column)
9999
self.routes = []

Solutions/2_5/readrides.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def read_rides_as_columns(filename):
8888
# The great "fake"
8989

9090
import collections
91-
class RideData(collections.Sequence):
91+
class RideData(collections.abc.Sequence):
9292
def __init__(self):
9393
# Each value is a list with all of the values (a column)
9494
self.routes = []

Solutions/2_6/colreader.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import collections
44
import csv
55

6-
class DataCollection(collections.Sequence):
6+
class DataCollection(collections.abc.Sequence):
77
def __init__(self, columns):
88
self.column_names = list(columns)
99
self.column_data = list(columns.values())
@@ -34,4 +34,3 @@ def read_csv_as_columns(filename, types):
3434
tracemalloc.start()
3535
data = read_csv_as_columns('../../Data/ctabus.csv', [intern, intern, intern, int])
3636
print(tracemalloc.get_traced_memory())
37-

0 commit comments

Comments
 (0)