Skip to content
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

Please confirm typing of _tzinfos kwarg for typeshed #36

Closed
angelaambroz opened this issue Oct 21, 2019 · 2 comments
Closed

Please confirm typing of _tzinfos kwarg for typeshed #36

angelaambroz opened this issue Oct 21, 2019 · 2 comments

Comments

@angelaambroz
Copy link

angelaambroz commented Oct 21, 2019

👋 Hi! New contributor here. I'm updating the typing stubs for pytz in typeshed (PR#3393), specifically adding FixedOffset's typing. I'm unsure about the kwarg though, _tzinfos.

Here's the line I've put in typeshed. @stub42 Can you confirm the typing of _tzinfos (and, of course, let me know if the other types are wrong). The typeshed tests run, and it looks right to me... but I don't know pytz well enough. Thanks!

@stub42
Copy link
Owner

stub42 commented Oct 22, 2019

The _tzinfos parameter is private (per the old _ prefix naming convention), and only intended for use by the unpickler. The type is some horrible data structure as you have found (and which I don't recall), but better if you can flag it as some opaque type.

@angelaambroz
Copy link
Author

Thanks for the quick reply. Given that, I might just remove the kwarg from the stub altogether, which will just let typing evaluate it to Any; if it's a complicated data structure and it's meant to be private, easier to just let it be whatever it is (i.e. no explicit/static type evaluation). Otherwise, I'm not sure what "opaque type" to flag it to!

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

No branches or pull requests

2 participants