Is BaseTzInfo a part of public API?

Asked by andreymal on 2018-08-10

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

Language:
English Edit question
Status:
Solved
For:
pytz Edit question
Assignee:
No assignee Edit question
Solved by:
Stuart Bishop
Solved:
2018-08-15
Last query:
2018-08-15
Last reply:
2018-08-15
Best Stuart Bishop (stub) said : #1

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.

andreymal (andreymal) said : #2

Thanks Stuart Bishop, that solved my question.