-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update stubs for pytz #3393
Update stubs for pytz #3393
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from typing import Optional, List, Set, Mapping, Union | ||
from typing import Optional, List, Set, Mapping, Union, Dict | ||
import datetime | ||
|
||
class BaseTzInfo(datetime.tzinfo): | ||
|
@@ -29,6 +29,7 @@ class NonExistentTimeError(InvalidTimeError): ... | |
utc: _UTCclass | ||
UTC: _UTCclass | ||
def timezone(zone: str) -> Union[_UTCclass, _StaticTzInfo, _DstTzInfo]: ... | ||
def FixedOffset(offset: int) -> Union[_UTCclass, _StaticTzInfo, _DstTzInfo]: ... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like If offset is 0, it returns a If offset is not 0, it returns a class A bit of a mess! I suppose you can add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree with bluetech here. The current return type seems suboptimal, because we generally discourage Union return types, and in fact it doesn't ever return a _StaticTzInfo or a _DstTzInfo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 馃憤 Thanks, both. And apologies for the silence - got sucked into other work. I can change the return type to |
||
|
||
all_timezones: List[str] | ||
all_timezones_set: Set[str] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to remove the Dict.