Skip to content

Commit 89a24f9

Browse files
committed
pandas-dev#25790 Updating type hints to Python3 syntax in pandas/core/array
1 parent dc86f02 commit 89a24f9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pandas/core/arrays/array_.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
from typing import Optional, Sequence, Union
1+
from typing import Optional, Sequence, TYPE_CHECKING, Union
22

33
import numpy as np
44

55
from pandas._libs import lib, tslibs
66

7-
from pandas.core.arrays.base import ExtensionArray
87
from pandas.core.dtypes.common import (
98
is_datetime64_ns_dtype, is_extension_array_dtype, is_timedelta64_ns_dtype)
109
from pandas.core.dtypes.dtypes import ExtensionDtype, registry
1110

1211
from pandas import compat
1312

1413

14+
if TYPE_CHECKING:
15+
from pandas.core.arrays.base import ExtensionArray
16+
17+
1518
def array(data: Sequence[object],
16-
dtype: Optional[str, np.dtype, ExtensionDtype] = None,
19+
dtype: Optional[Union[str, np.dtype, ExtensionDtype]] = None,
1720
copy: bool = True,
18-
) -> ExtensionArray:
21+
) -> 'ExtensionArray':
1922
"""
2023
Create an array.
2124

0 commit comments

Comments
 (0)