@@ -1225,7 +1225,12 @@ def join(self, sep: str):
12251225
12261226 @forbid_nonstring_types (["bytes" ])
12271227 def contains (
1228- self , pat , case : bool = True , flags : int = 0 , na = None , regex : bool = True
1228+ self ,
1229+ pat ,
1230+ case : bool = True ,
1231+ flags : int = 0 ,
1232+ na = lib .no_default ,
1233+ regex : bool = True ,
12291234 ):
12301235 r"""
12311236 Test if pattern or regex is contained within a string of a Series or Index.
@@ -1243,8 +1248,9 @@ def contains(
12431248 Flags to pass through to the re module, e.g. re.IGNORECASE.
12441249 na : scalar, optional
12451250 Fill value for missing values. The default depends on dtype of the
1246- array. For object-dtype, ``numpy.nan`` is used. For ``StringDtype``,
1247- ``pandas.NA`` is used.
1251+ array. For object-dtype, ``numpy.nan`` is used. For the nullable
1252+ ``StringDtype``, ``pandas.NA`` is used. For the ``"str"`` dtype,
1253+ ``False`` is used.
12481254 regex : bool, default True
12491255 If True, assumes the pat is a regular expression.
12501256
@@ -1362,7 +1368,7 @@ def contains(
13621368 return self ._wrap_result (result , fill_value = na , returns_string = False )
13631369
13641370 @forbid_nonstring_types (["bytes" ])
1365- def match (self , pat : str , case : bool = True , flags : int = 0 , na = None ):
1371+ def match (self , pat : str , case : bool = True , flags : int = 0 , na = lib . no_default ):
13661372 """
13671373 Determine if each string starts with a match of a regular expression.
13681374
@@ -1376,8 +1382,9 @@ def match(self, pat: str, case: bool = True, flags: int = 0, na=None):
13761382 Regex module flags, e.g. re.IGNORECASE.
13771383 na : scalar, optional
13781384 Fill value for missing values. The default depends on dtype of the
1379- array. For object-dtype, ``numpy.nan`` is used. For ``StringDtype``,
1380- ``pandas.NA`` is used.
1385+ array. For object-dtype, ``numpy.nan`` is used. For the nullable
1386+ ``StringDtype``, ``pandas.NA`` is used. For the ``"str"`` dtype,
1387+ ``False`` is used.
13811388
13821389 Returns
13831390 -------
@@ -1406,7 +1413,7 @@ def match(self, pat: str, case: bool = True, flags: int = 0, na=None):
14061413 return self ._wrap_result (result , fill_value = na , returns_string = False )
14071414
14081415 @forbid_nonstring_types (["bytes" ])
1409- def fullmatch (self , pat , case : bool = True , flags : int = 0 , na = None ):
1416+ def fullmatch (self , pat , case : bool = True , flags : int = 0 , na = lib . no_default ):
14101417 """
14111418 Determine if each string entirely matches a regular expression.
14121419
@@ -1420,8 +1427,9 @@ def fullmatch(self, pat, case: bool = True, flags: int = 0, na=None):
14201427 Regex module flags, e.g. re.IGNORECASE.
14211428 na : scalar, optional
14221429 Fill value for missing values. The default depends on dtype of the
1423- array. For object-dtype, ``numpy.nan`` is used. For ``StringDtype``,
1424- ``pandas.NA`` is used.
1430+ array. For object-dtype, ``numpy.nan`` is used. For the nullable
1431+ ``StringDtype``, ``pandas.NA`` is used. For the ``"str"`` dtype,
1432+ ``False`` is used.
14251433
14261434 Returns
14271435 -------
@@ -2612,7 +2620,7 @@ def count(self, pat, flags: int = 0):
26122620
26132621 @forbid_nonstring_types (["bytes" ])
26142622 def startswith (
2615- self , pat : str | tuple [str , ...], na : Scalar | None = None
2623+ self , pat : str | tuple [str , ...], na : Scalar | lib . NoDefault = lib . no_default
26162624 ) -> Series | Index :
26172625 """
26182626 Test if the start of each string element matches a pattern.
@@ -2624,10 +2632,11 @@ def startswith(
26242632 pat : str or tuple[str, ...]
26252633 Character sequence or tuple of strings. Regular expressions are not
26262634 accepted.
2627- na : object, default NaN
2635+ na : scalar, optional
26282636 Object shown if element tested is not a string. The default depends
26292637 on dtype of the array. For object-dtype, ``numpy.nan`` is used.
2630- For ``StringDtype``, ``pandas.NA`` is used.
2638+ For the nullable ``StringDtype``, ``pandas.NA`` is used.
2639+ For the ``"str"`` dtype, ``False`` is used.
26312640
26322641 Returns
26332642 -------
@@ -2682,7 +2691,7 @@ def startswith(
26822691
26832692 @forbid_nonstring_types (["bytes" ])
26842693 def endswith (
2685- self , pat : str | tuple [str , ...], na : Scalar | None = None
2694+ self , pat : str | tuple [str , ...], na : Scalar | lib . NoDefault = lib . no_default
26862695 ) -> Series | Index :
26872696 """
26882697 Test if the end of each string element matches a pattern.
@@ -2694,10 +2703,11 @@ def endswith(
26942703 pat : str or tuple[str, ...]
26952704 Character sequence or tuple of strings. Regular expressions are not
26962705 accepted.
2697- na : object, default NaN
2706+ na : scalar, optional
26982707 Object shown if element tested is not a string. The default depends
26992708 on dtype of the array. For object-dtype, ``numpy.nan`` is used.
2700- For ``StringDtype``, ``pandas.NA`` is used.
2709+ For the nullable ``StringDtype``, ``pandas.NA`` is used.
2710+ For the ``"str"`` dtype, ``False`` is used.
27012711
27022712 Returns
27032713 -------
0 commit comments