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

[mypy] Explicit re-export #695

Closed
2 tasks done
AdrienPensart opened this issue Mar 1, 2023 · 3 comments
Closed
2 tasks done

[mypy] Explicit re-export #695

AdrienPensart opened this issue Mar 1, 2023 · 3 comments

Comments

@AdrienPensart
Copy link

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

Hello / Salut!

I have two minor issues when using static typing tool :

error: "Module pendulum" does not explicitly export attribute "timezone" [attr-defined]
canada = pendulum.timezone("America/Toronto")
^~~~~~~~~~~~~~~~~
error: Name "pendulum.Period" is not defined [name-defined]
delta: pendulum.Period = time_spent[1] - time_spent[0]
^

Is is possible to explicitely re-export all needed / most-used symbols in pendulum/init.py ?

Thank you!

@bryanforbes
Copy link
Contributor

I believe this has been addressed in #680

@sdebruyn
Copy link

I believe this has been addressed in #680

I don't think so. You'd need to put something like

__all__ = [
    "Period",
]

in __init__.py in the pendulum package

@Secrus
Copy link
Collaborator

Secrus commented Jun 10, 2023

Should be fine now. Notice that in Pendulum 3.0 Period is renamed to Interval.

@Secrus Secrus closed this as completed Jun 10, 2023
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

4 participants