@@ -127,8 +127,8 @@ def ctrlpts(self):
127127 # Populate the cache, if necessary
128128 if not self ._cache ['ctrlpts' ]:
129129 c , w = compatibility .separate_ctrlpts_weights (self ._control_points )
130- self ._cache ['ctrlpts' ] = [ crd for crd in c ]
131- self ._cache ['weights' ] = w
130+ self ._cache ['ctrlpts' ] = self . _array_type ( iter ( c ))
131+ self ._cache ['weights' ] = self . _array_type ( iter ( w ))
132132 return self ._cache ['ctrlpts' ]
133133
134134 @ctrlpts .setter
@@ -159,8 +159,8 @@ def weights(self):
159159 # Populate the cache, if necessary
160160 if not self ._cache ['weights' ]:
161161 c , w = compatibility .separate_ctrlpts_weights (self ._control_points )
162- self ._cache ['ctrlpts' ] = [ crd for crd in c ]
163- self ._cache ['weights' ] = w
162+ self ._cache ['ctrlpts' ] = self . _array_type ( iter ( c ))
163+ self ._cache ['weights' ] = self . _array_type ( iter ( w ))
164164 return self ._cache ['weights' ]
165165
166166 @weights .setter
@@ -192,6 +192,7 @@ def reset(self, **kwargs):
192192 if reset_ctrlpts :
193193 # Delete the caches
194194 self ._cache ['ctrlpts' ] = self ._init_array ()
195+ # TODO: why is this reset differently from the initialisation?
195196 self ._cache ['weights' ][:] = self ._init_array ()
196197
197198
@@ -330,8 +331,8 @@ def ctrlpts(self):
330331 """
331332 if not self ._cache ['ctrlpts' ]:
332333 c , w = compatibility .separate_ctrlpts_weights (self ._control_points )
333- self ._cache ['ctrlpts' ] = [ crd for crd in c ]
334- self ._cache ['weights' ] = w
334+ self ._cache ['ctrlpts' ] = self . _array_type ( iter ( c ))
335+ self ._cache ['weights' ] = self . _array_type ( iter ( w ))
335336 return self ._cache ['ctrlpts' ]
336337
337338 @ctrlpts .setter
@@ -361,8 +362,8 @@ def weights(self):
361362 """
362363 if not self ._cache ['weights' ]:
363364 c , w = compatibility .separate_ctrlpts_weights (self ._control_points )
364- self ._cache ['ctrlpts' ] = [ crd for crd in c ]
365- self ._cache ['weights' ] = w
365+ self ._cache ['ctrlpts' ] = self . _array_type ( iter ( c ))
366+ self ._cache ['weights' ] = self . _array_type ( iter ( w ))
366367 return self ._cache ['weights' ]
367368
368369 @weights .setter
@@ -518,8 +519,8 @@ def ctrlpts(self):
518519 """
519520 if not self ._cache ['ctrlpts' ]:
520521 c , w = compatibility .separate_ctrlpts_weights (self ._control_points )
521- self ._cache ['ctrlpts' ] = [ crd for crd in c ]
522- self ._cache ['weights' ] = w
522+ self ._cache ['ctrlpts' ] = self . _array_type ( iter ( c ))
523+ self ._cache ['weights' ] = self . _array_type ( iter ( w ))
523524 return self ._cache ['ctrlpts' ]
524525
525526 @ctrlpts .setter
@@ -549,8 +550,8 @@ def weights(self):
549550 """
550551 if not self ._cache ['weights' ]:
551552 c , w = compatibility .separate_ctrlpts_weights (self ._control_points )
552- self ._cache ['ctrlpts' ] = [ crd for crd in c ]
553- self ._cache ['weights' ] = w
553+ self ._cache ['ctrlpts' ] = self . _array_type ( iter ( c ))
554+ self ._cache ['weights' ] = self . _array_type ( iter ( w ))
554555 return self ._cache ['weights' ]
555556
556557 @weights .setter
0 commit comments