Skip to content

ExtensionArray.astype docstring #24773

Open
@andrewgsavage

Description

@andrewgsavage

def astype(self, dtype, copy=True):

Should the docstring say that this should return an ExtensionArray when an ExtensionType is passed into it?
I note that PeriodArray behaves like this.

import pandas as pd
a=pd.core.arrays.period_array([2000, 2001, 2002], freq='D')
type(a.dtype)

pandas.core.dtypes.dtypes.PeriodDtype

type(a.astype(a.dtype))

pandas.core.arrays.period.PeriodArray

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions