@@ -1020,66 +1020,116 @@ def startswith(
1020
1020
def str_len (A : UST_co ) -> NDArray [int_ ]: ...
1021
1021
1022
1022
# Overload 1 and 2: str- or bytes-based array-likes
1023
- # overload 3: arbitrary object with unicode=False (-> bytes_)
1024
- # overload 4: arbitrary object with unicode=True (-> str_)
1023
+ # overload 3 and 4: arbitrary object with unicode=False (-> bytes_)
1024
+ # overload 5 and 6: arbitrary object with unicode=True (-> str_)
1025
+ # overload 7: arbitrary object with unicode=None (default) (-> str_ | bytes_)
1025
1026
@overload
1026
1027
def array (
1027
1028
obj : U_co ,
1028
1029
itemsize : int | None = ...,
1029
1030
copy : bool = ...,
1030
- unicode : L [False ] = ...,
1031
+ unicode : L [True ] | None = ...,
1031
1032
order : _OrderKACF = ...,
1032
1033
) -> _CharArray [str_ ]: ...
1033
1034
@overload
1034
1035
def array (
1035
1036
obj : S_co ,
1036
1037
itemsize : int | None = ...,
1037
1038
copy : bool = ...,
1038
- unicode : L [False ] = ...,
1039
+ unicode : L [False ] | None = ...,
1040
+ order : _OrderKACF = ...,
1041
+ ) -> _CharArray [bytes_ ]: ...
1042
+ @overload
1043
+ def array (
1044
+ obj : object ,
1045
+ itemsize : int | None ,
1046
+ copy : bool ,
1047
+ unicode : L [False ],
1039
1048
order : _OrderKACF = ...,
1040
1049
) -> _CharArray [bytes_ ]: ...
1041
1050
@overload
1042
1051
def array (
1043
1052
obj : object ,
1044
1053
itemsize : int | None = ...,
1045
1054
copy : bool = ...,
1046
- unicode : L [False ] = ...,
1055
+ * ,
1056
+ unicode : L [False ],
1047
1057
order : _OrderKACF = ...,
1048
1058
) -> _CharArray [bytes_ ]: ...
1049
1059
@overload
1060
+ def array (
1061
+ obj : object ,
1062
+ itemsize : int | None ,
1063
+ copy : bool ,
1064
+ unicode : L [True ],
1065
+ order : _OrderKACF = ...,
1066
+ ) -> _CharArray [str_ ]: ...
1067
+ @overload
1050
1068
def array (
1051
1069
obj : object ,
1052
1070
itemsize : int | None = ...,
1053
1071
copy : bool = ...,
1054
- unicode : L [True ] = ...,
1072
+ * ,
1073
+ unicode : L [True ],
1055
1074
order : _OrderKACF = ...,
1056
1075
) -> _CharArray [str_ ]: ...
1076
+ @overload
1077
+ def array (
1078
+ obj : object ,
1079
+ itemsize : int | None = ...,
1080
+ copy : bool = ...,
1081
+ unicode : bool | None = ...,
1082
+ order : _OrderKACF = ...,
1083
+ ) -> _CharArray [str_ ] | _CharArray [bytes_ ]: ...
1057
1084
1058
1085
@overload
1059
1086
def asarray (
1060
1087
obj : U_co ,
1061
1088
itemsize : int | None = ...,
1062
- unicode : L [False ] = ...,
1089
+ unicode : L [True ] | None = ...,
1063
1090
order : _OrderKACF = ...,
1064
1091
) -> _CharArray [str_ ]: ...
1065
1092
@overload
1066
1093
def asarray (
1067
1094
obj : S_co ,
1068
1095
itemsize : int | None = ...,
1069
- unicode : L [False ] = ...,
1096
+ unicode : L [False ] | None = ...,
1097
+ order : _OrderKACF = ...,
1098
+ ) -> _CharArray [bytes_ ]: ...
1099
+ @overload
1100
+ def asarray (
1101
+ obj : object ,
1102
+ itemsize : int | None ,
1103
+ unicode : L [False ],
1070
1104
order : _OrderKACF = ...,
1071
1105
) -> _CharArray [bytes_ ]: ...
1072
1106
@overload
1073
1107
def asarray (
1074
1108
obj : object ,
1075
1109
itemsize : int | None = ...,
1076
- unicode : L [False ] = ...,
1110
+ * ,
1111
+ unicode : L [False ],
1077
1112
order : _OrderKACF = ...,
1078
1113
) -> _CharArray [bytes_ ]: ...
1079
1114
@overload
1115
+ def asarray (
1116
+ obj : object ,
1117
+ itemsize : int | None ,
1118
+ unicode : L [True ],
1119
+ order : _OrderKACF = ...,
1120
+ ) -> _CharArray [str_ ]: ...
1121
+ @overload
1080
1122
def asarray (
1081
1123
obj : object ,
1082
1124
itemsize : int | None = ...,
1083
- unicode : L [True ] = ...,
1125
+ * ,
1126
+ unicode : L [True ],
1084
1127
order : _OrderKACF = ...,
1085
1128
) -> _CharArray [str_ ]: ...
1129
+ @overload
1130
+ def asarray (
1131
+ obj : object ,
1132
+ itemsize : int | None = ...,
1133
+ unicode : bool | None = ...,
1134
+ order : _OrderKACF = ...,
1135
+ ) -> _CharArray [str_ ] | _CharArray [bytes_ ]: ...
0 commit comments