@@ -130,31 +130,34 @@ def __init__(self, hatch, density):
130130 path = Path .unit_circle ()
131131 self .shape_vertices = path .vertices
132132 self .shape_codes = path .codes
133- Shapes .__init__ (self , hatch , density )
133+ super () .__init__ (hatch , density )
134134
135135
136136class SmallCircles (Circles ):
137137 size = 0.2
138138
139139 def __init__ (self , hatch , density ):
140140 self .num_rows = (hatch .count ('o' )) * density
141- Circles .__init__ (self , hatch , density )
141+ super () .__init__ (hatch , density )
142142
143143
144144class LargeCircles (Circles ):
145145 size = 0.35
146146
147147 def __init__ (self , hatch , density ):
148148 self .num_rows = (hatch .count ('O' )) * density
149- Circles .__init__ (self , hatch , density )
149+ super () .__init__ (hatch , density )
150150
151151
152+ # TODO: __init__ and class attributes override all attributes set by
153+ # SmallCircles. Should this class derive from Circles instead?
152154class SmallFilledCircles (SmallCircles ):
153155 size = 0.1
154156 filled = True
155157
156158 def __init__ (self , hatch , density ):
157159 self .num_rows = (hatch .count ('.' )) * density
160+ # Not super().__init__!
158161 Circles .__init__ (self , hatch , density )
159162
160163
@@ -169,7 +172,7 @@ def __init__(self, hatch, density):
169172 self .shape_codes = np .full (len (self .shape_vertices ), Path .LINETO ,
170173 dtype = Path .code_type )
171174 self .shape_codes [0 ] = Path .MOVETO
172- Shapes .__init__ (self , hatch , density )
175+ super () .__init__ (hatch , density )
173176
174177_hatch_types = [
175178 HorizontalHatch ,
0 commit comments