Closed kolomenkin closed 4 years ago
@kolomenkin Thanks for the report and apologies for the issue.
I wasn't seeing any of the reported issues that you listed above in ulid/api.py
. Possible a difference in mypy version or when it's run vs. referenced as a lib? Not sure.
In any case, I believe I've addressed this in my PR. You can build from source to test if needed; otherwise I should have a new patch version out relatively soon with these changes.
Please reopen if you still experience these issues with those changes.
Reopening; I've found a way to reproduce the additional errors in strict mode.
Hi, my project is using
mypy --strict
. While importing ulid I'm getting a problem:I found a workaround:
But I'm sure the first way is a bit more preferable.
Investigation
I made some investigation on the problem. The following modified content of
__init__.py
should fix the problem:So I explicitly imported items and explicitly listed them in
__all__
. This is some code duplication, but it looks not fatal for me.Questions
Q1. Should I create PR with the these changes for in
__init__.py
?Q2. Should I crate PR to fix all
mypy --strict
errors for the whole ulid project? The fixes are going to be trivial from my experience. Here is the full list of mypy errors: