File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,22 @@ def take(
174174 fill_value = fill_value ,
175175 axis = axis ,
176176 )
177+ # One of the base classes to this class: ExtensionArray, provides
178+ # the dtype property, but abstractly, so it leaves the implementation
179+ # of dtype storage up to its derived classes. Some of these derived
180+ # classes don't provide a setter method for their dtype property, so
181+ # I can't set the dtype here and expect it to work for all classes that
182+ # inherit this take method.
183+
184+ # How can I produce an extension array of the same type as self,
185+ # having a floating-point dtype if self has an integer dtype or otherwise
186+ # the same dtype as self?
187+
188+ # Constructing a new object of the same type as self doesn't always
189+ # work since the constructors of some derived classes of this class
190+ # don't accept a dtype parameter, which I need to pass to set the
191+ # result's dtype to a floating-point type.
192+
177193 if self .dtype in [
178194 NumpyEADtype (np .uint8 ),
179195 NumpyEADtype (np .uint16 ),
You can’t perform that action at this time.
0 commit comments