mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
dateutil.parser: Complete the isoparser module (#5983)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
from datetime import datetime, tzinfo
|
||||
from typing import IO, Any, Mapping, Text, Tuple, Union
|
||||
|
||||
from .isoparser import isoparse as isoparse, isoparser as isoparser
|
||||
|
||||
_FileOrStr = Union[bytes, Text, IO[str], IO[Any]]
|
||||
|
||||
class parserinfo(object):
|
||||
@@ -35,8 +37,6 @@ class parser(object):
|
||||
**kwargs: Any,
|
||||
) -> datetime: ...
|
||||
|
||||
def isoparse(dt_str: str | bytes | IO[str] | IO[bytes]) -> datetime: ...
|
||||
|
||||
DEFAULTPARSER: parser
|
||||
|
||||
def parse(timestr: _FileOrStr, parserinfo: parserinfo | None = ..., **kwargs: Any) -> datetime: ...
|
||||
@@ -45,7 +45,4 @@ class _tzparser: ...
|
||||
|
||||
DEFAULTTZPARSER: _tzparser
|
||||
|
||||
class InvalidDatetimeError(ValueError): ...
|
||||
class InvalidDateError(InvalidDatetimeError): ...
|
||||
class InvalidTimeError(InvalidDatetimeError): ...
|
||||
class ParserError(ValueError): ...
|
||||
15
stubs/python-dateutil/dateutil/parser/isoparser.pyi
Normal file
15
stubs/python-dateutil/dateutil/parser/isoparser.pyi
Normal file
@@ -0,0 +1,15 @@
|
||||
from _typeshed import SupportsRead
|
||||
from datetime import date, datetime, time, tzinfo
|
||||
from typing import Text, Union
|
||||
|
||||
_Readable = SupportsRead[Union[Text, bytes]]
|
||||
_TakesAscii = Union[Text, bytes, _Readable]
|
||||
|
||||
class isoparser:
|
||||
def __init__(self, sep: Text | bytes | None = ...): ...
|
||||
def isoparse(self, dt_str: _TakesAscii) -> datetime: ...
|
||||
def parse_isodate(self, datestr: _TakesAscii) -> date: ...
|
||||
def parse_isotime(self, timestr: _TakesAscii) -> time: ...
|
||||
def parse_tzstr(self, tzstr: _TakesAscii, zero_as_utc: bool = ...) -> tzinfo: ...
|
||||
|
||||
def isoparse(dt_str: _TakesAscii) -> datetime: ...
|
||||
Reference in New Issue
Block a user