Skip to content

Conversation

@hauntsaninja
Copy link
Collaborator

Resolves #4448

Co-authored by: Akuli

Co-authored by: Akuli
def tm_gmtoff(self) -> int: ...
if sys.version_info >= (3, 6):
@property
def tm_zone(self) -> str: ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does exist in 3.5 on Linux.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs say that it's platform specific before Python 3.6 https://docs.python.org/3/library/time.html

@Akuli
Copy link
Collaborator

Akuli commented Aug 17, 2020

There might be non-windows systems that lack tm_zone, and those will type check pass and get runtime error. I guess that's preferred over failing type check but working correctly at runtime?

@hauntsaninja
Copy link
Collaborator Author

Yup! Also generally speaking, we don't do a great job of platforms outside of linux, win32, darwin (and up until we got stubtest running on windows, win32 had a lot of room for improvement too). For instance, we run flake8-pyi in typeshed CI and it currently only recognises four sys.platform values: https://github.com/ambv/flake8-pyi/blob/cdd527b601d95da1b5223a6be54ce0c675771b4b/pyi.py#L271 And of course, we'd be receptive to improvements for other platforms if we ever got issues or PRs :-)

@JelleZijlstra JelleZijlstra merged commit f23ce60 into python:master Aug 17, 2020
@hauntsaninja hauntsaninja deleted the winstub branch August 17, 2020 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stubtest on windows isn't doing anything

3 participants