@@ -130,31 +130,34 @@ def __init__(self, hatch, density):
130
130
path = Path .unit_circle ()
131
131
self .shape_vertices = path .vertices
132
132
self .shape_codes = path .codes
133
- Shapes .__init__ (self , hatch , density )
133
+ super () .__init__ (hatch , density )
134
134
135
135
136
136
class SmallCircles (Circles ):
137
137
size = 0.2
138
138
139
139
def __init__ (self , hatch , density ):
140
140
self .num_rows = (hatch .count ('o' )) * density
141
- Circles .__init__ (self , hatch , density )
141
+ super () .__init__ (hatch , density )
142
142
143
143
144
144
class LargeCircles (Circles ):
145
145
size = 0.35
146
146
147
147
def __init__ (self , hatch , density ):
148
148
self .num_rows = (hatch .count ('O' )) * density
149
- Circles .__init__ (self , hatch , density )
149
+ super () .__init__ (hatch , density )
150
150
151
151
152
+ # TODO: __init__ and class attributes override all attributes set by
153
+ # SmallCircles. Should this class derive from Circles instead?
152
154
class SmallFilledCircles (SmallCircles ):
153
155
size = 0.1
154
156
filled = True
155
157
156
158
def __init__ (self , hatch , density ):
157
159
self .num_rows = (hatch .count ('.' )) * density
160
+ # Not super().__init__!
158
161
Circles .__init__ (self , hatch , density )
159
162
160
163
@@ -169,7 +172,7 @@ def __init__(self, hatch, density):
169
172
self .shape_codes = np .full (len (self .shape_vertices ), Path .LINETO ,
170
173
dtype = Path .code_type )
171
174
self .shape_codes [0 ] = Path .MOVETO
172
- Shapes .__init__ (self , hatch , density )
175
+ super () .__init__ (hatch , density )
173
176
174
177
_hatch_types = [
175
178
HorizontalHatch ,
0 commit comments