Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

chore: Drop dependency on pytz by using stdlib datetime.timezone.utc #721

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 3 commits into from
Oct 4, 2023
Merged
Changes from 1 commit
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
Next Next commit
Fix type hints for non-None return
  • Loading branch information
Zac-HD committed Aug 24, 2023
commit 6b98d156146e4fd31d666f86ffecb766dd9c7f3a
8 changes: 4 additions & 4 deletions 8 twilio/base/deserialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ISO8601_DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"


def iso8601_date(s: str) -> Optional[Union[datetime.date, str]]:
def iso8601_date(s: str) -> Union[datetime.date, str]:
"""
Parses an ISO 8601 date string and returns a UTC date object or the string
if the parsing failed.
Expand All @@ -28,7 +28,7 @@ def iso8601_date(s: str) -> Optional[Union[datetime.date, str]]:

def iso8601_datetime(
s: str,
) -> Optional[Union[datetime.datetime, str]]:
) -> Union[datetime.datetime, str]:
"""
Parses an ISO 8601 datetime string and returns a UTC datetime object,
or the string if parsing failed.
Expand All @@ -55,7 +55,7 @@ def rfc2822_datetime(s: str) -> Optional[datetime.datetime]:
return datetime.datetime(*date_tuple[:6]).replace(tzinfo=pytz.utc)


def decimal(d: Optional[str]) -> Optional[Union[Decimal, str]]:
def decimal(d: Optional[str]) -> Union[Decimal, str]:
"""
Parses a decimal string into a Decimal
:param d: decimal string
Expand All @@ -65,7 +65,7 @@ def decimal(d: Optional[str]) -> Optional[Union[Decimal, str]]:
return Decimal(d, BasicContext)


def integer(i: str) -> Optional[Union[int, str]]:
def integer(i: str) -> Union[int, str]:
"""
Parses an integer string into an int
:param i: integer string
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.