Skip to content

Adding py36 additions to datetime module #1848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 35 additions & 10 deletions stdlib/2and3/datetime.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ class time:
def microsecond(self) -> int: ...
@property
def tzinfo(self) -> Optional[_tzinfo]: ...
if sys.version_info >= (3, 6):
@property
def fold(self) -> int: ...

def __le__(self, other: time) -> bool: ...
def __lt__(self, other: time) -> bool: ...
Expand All @@ -108,8 +111,13 @@ class time:
def utcoffset(self) -> Optional[timedelta]: ...
def tzname(self) -> Optional[str]: ...
def dst(self) -> Optional[int]: ...
def replace(self, hour: int = ..., minute: int = ..., second: int = ...,
microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...) -> time: ...
if sys.version_info >= (3, 6):
def replace(self, hour: int = ..., minute: int = ..., second: int = ...,
microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...,
*, fold: int = ...) -> time: ...
else:
def replace(self, hour: int = ..., minute: int = ..., second: int = ...,
microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...) -> time: ...

_date = date
_time = time
Expand Down Expand Up @@ -168,9 +176,14 @@ class datetime:
max: ClassVar[datetime]
resolution: ClassVar[timedelta]

def __init__(self, year: int, month: int, day: int, hour: int = ...,
minute: int = ..., second: int = ..., microsecond: int = ...,
tzinfo: Optional[tzinfo] = ...) -> None: ...
if sys.version_info >= (3, 6):
def __init__(self, year: int, month: int, day: int, hour: int = ...,
minute: int = ..., second: int = ..., microsecond: int = ...,
tzinfo: Optional[tzinfo] = ..., *, fold: int = ...) -> None: ...
else:
def __init__(self, year: int, month: int, day: int, hour: int = ...,
minute: int = ..., second: int = ..., microsecond: int = ...,
tzinfo: Optional[tzinfo] = ...) -> None: ...

@property
def year(self) -> int: ...
Expand All @@ -188,6 +201,9 @@ class datetime:
def microsecond(self) -> int: ...
@property
def tzinfo(self) -> Optional[_tzinfo]: ...
if sys.version_info >= (3, 6):
@property
def fold(self) -> int: ...

@classmethod
def fromtimestamp(cls, t: float, tz: Optional[_tzinfo] = ...) -> datetime: ...
Expand All @@ -201,8 +217,12 @@ class datetime:
def now(cls, tz: Optional[_tzinfo] = ...) -> datetime: ...
@classmethod
def utcnow(cls) -> datetime: ...
@classmethod
def combine(cls, date: date, time: time) -> datetime: ...
if sys.version_info >= (3, 6):
@classmethod
def combine(cls, date: date, time: time, tzinfo: Optional[_tzinfo] = ...) -> datetime: ...
else:
@classmethod
def combine(cls, date: date, time: time) -> datetime: ...
def strftime(self, fmt: _Text) -> str: ...
if sys.version_info >= (3,):
def __format__(self, fmt: str) -> str: ...
Expand All @@ -216,9 +236,14 @@ class datetime:
def date(self) -> _date: ...
def time(self) -> _time: ...
def timetz(self) -> _time: ...
def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,
minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:
Optional[_tzinfo] = ...) -> datetime: ...
if sys.version_info >= (3, 6):
def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,
minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:
Optional[_tzinfo] = ..., *, fold: int = ...) -> datetime: ...
else:
def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,
minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:
Optional[_tzinfo] = ...) -> datetime: ...
if sys.version_info >= (3, 3):
def astimezone(self, tz: Optional[_tzinfo] = ...) -> datetime: ...
else:
Expand Down