Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Commit

Permalink
Add stub for pyrfc3339 (python#4564)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmeurisse authored Nov 1, 2020
1 parent cdc4de1 commit 0e002f4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions third_party/3/pyrfc3339/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .generator import generate as generate
from .parser import parse as parse
3 changes: 3 additions & 0 deletions third_party/3/pyrfc3339/generator.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from datetime import datetime

def generate(dt: datetime, utc: bool = ..., accept_naive: bool = ..., microseconds: bool = ...) -> str: ...
3 changes: 3 additions & 0 deletions third_party/3/pyrfc3339/parser.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from datetime import datetime

def parse(timestamp: str, utc: bool = ..., produce_naive: bool = ...) -> datetime: ...
11 changes: 11 additions & 0 deletions third_party/3/pyrfc3339/utils.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from datetime import datetime, timedelta, tzinfo
from typing import Optional

class FixedOffset(tzinfo):
def __init__(self, hours: float, minutes: float) -> None: ...
def dst(self, dt: Optional[datetime]) -> timedelta: ...
def utcoffset(self, dt: Optional[datetime]) -> timedelta: ...
def tzname(self, dt: Optional[datetime]) -> str: ...

def timedelta_seconds(td: timedelta) -> int: ...
def timezone(utcoffset: float) -> str: ...

0 comments on commit 0e002f4

Please sign in to comment.