-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #636 from aiven/aiven-anton/fix/add-stubs-for-isodate
chore: Add partial stubs for the isodate library
- Loading branch information
Showing
7 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from isodate.isoduration import duration_isoformat, parse_duration | ||
|
||
__all__ = ("duration_isoformat", "parse_duration") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from decimal import Decimal | ||
|
||
import datetime | ||
|
||
class Duration: | ||
months: Decimal | ||
years: Decimal | ||
tdelta: datetime.timedelta | ||
|
||
def __init__( | ||
self, | ||
days: int = ..., | ||
seconds: int = ..., | ||
microseconds: int = ..., | ||
milliseconds: int = ..., | ||
minutes: int = ..., | ||
hours: int = ..., | ||
weeks: int = ..., | ||
months: int = ..., | ||
years: int = ..., | ||
) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from .duration import Duration | ||
from typing import Literal, overload | ||
|
||
import datetime | ||
|
||
@overload | ||
def parse_duration( | ||
datestring: str, | ||
) -> datetime.timedelta | Duration: ... | ||
@overload | ||
def parse_duration( | ||
datestring: str, | ||
as_timedelta_if_possible: Literal[False], | ||
) -> Duration: ... | ||
def duration_isoformat( | ||
tduration: Duration | datetime.timedelta, | ||
format: str = ..., | ||
) -> str: ... |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters