@@ -3,7 +3,7 @@ from _typeshed import SupportsRead
33from collections .abc import Callable , Mapping
44from datetime import _TzInfo , datetime
55from io import StringIO
6- from typing import IO , Any
6+ from typing import IO , Any , Literal , overload
77from typing_extensions import Self , TypeAlias
88
99_FileOrStr : TypeAlias = bytes | str | IO [str ] | IO [Any ]
@@ -77,6 +77,7 @@ class _ymd(list[int]):
7777class parser :
7878 info : parserinfo
7979 def __init__ (self , info : parserinfo | None = None ) -> None : ...
80+ @overload
8081 def parse (
8182 self ,
8283 timestr : _FileOrStr ,
@@ -87,11 +88,25 @@ class parser:
8788 dayfirst : bool | None = ...,
8889 yearfirst : bool | None = ...,
8990 fuzzy : bool = ...,
90- fuzzy_with_tokens : bool = ... ,
91+ fuzzy_with_tokens : Literal [ False ] = False ,
9192 ) -> datetime : ...
93+ @overload
94+ def parse (
95+ self ,
96+ timestr : _FileOrStr ,
97+ default : datetime | None = None ,
98+ ignoretz : bool = False ,
99+ tzinfos : _TzInfos | None = None ,
100+ * ,
101+ dayfirst : bool | None = ...,
102+ yearfirst : bool | None = ...,
103+ fuzzy : bool = ...,
104+ fuzzy_with_tokens : Literal [True ],
105+ ) -> tuple [datetime , tuple [str , ...]]: ...
92106
93107DEFAULTPARSER : parser
94108
109+ @overload
95110def parse (
96111 timestr : _FileOrStr ,
97112 parserinfo : parserinfo | None = None ,
@@ -100,10 +115,23 @@ def parse(
100115 yearfirst : bool | None = ...,
101116 ignoretz : bool = ...,
102117 fuzzy : bool = ...,
103- fuzzy_with_tokens : bool = ... ,
118+ fuzzy_with_tokens : Literal [ False ] = False ,
104119 default : datetime | None = ...,
105120 tzinfos : _TzInfos | None = ...,
106121) -> datetime : ...
122+ @overload
123+ def parse (
124+ timestr : _FileOrStr ,
125+ parserinfo : parserinfo | None = None ,
126+ * ,
127+ dayfirst : bool | None = ...,
128+ yearfirst : bool | None = ...,
129+ ignoretz : bool = ...,
130+ fuzzy : bool = ...,
131+ fuzzy_with_tokens : Literal [True ],
132+ default : datetime | None = ...,
133+ tzinfos : _TzInfos | None = ...,
134+ ) -> tuple [datetime , tuple [str , ...]]: ...
107135
108136class _tzparser :
109137 class _result (_resultbase ):
0 commit comments