Is BaseTzInfo a part of public API?

Asked by andreymal

There are two things:

1) I want to check that a some object is a pytz timezone;
2) and I want to use mypy+typeshed for static type checking.

`isinstance(obj, pytz.BaseTzInfo)` works great. But mypy prints error: `Module has no attribute "BaseTzInfo"`. That's because typeshed thinks that BaseTzInfo is not a part of public API, so I can't use it.

So, my question is in the title: is BaseTzInfo a part of public API?

If this is a public API, please describe it in the documentation explicitly. Then I can open a bug report in the typeshed repository.

If this is a private API, then why? How should I check object type?

Question information

English Edit question
pytz Edit question
No assignee Edit question
Solved by:
Stuart Bishop
Last query:
Last reply:
Revision history for this message
Best Stuart Bishop (stub) said :

No, but I see no reason not to promote it. I've added it to pytz.__all__, so tools should consider it public API next release.

Revision history for this message
andreymal (andreymal) said :

Thanks Stuart Bishop, that solved my question.