Skip to content

Explicitly export status categories #989

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

Open
medihack opened this issue Apr 2, 2025 · 1 comment
Open

Explicitly export status categories #989

medihack opened this issue Apr 2, 2025 · 1 comment

Comments

@medihack
Copy link
Contributor

medihack commented Apr 2, 2025

Describe the bug
The status categories are currently defined in pynetdicom._globals. Unfortunately, pyright complains when importing from a private module. The categories are also imported in pynetdicom.status, but not explicitly exported (__all__). So, pyright does complain when importing from there, too.

Expected behavior
Make the status categories importable conform to type checkers.

Steps To Reproduce
Have from pynetdicom._globals import STATUS_SUCCESS or from pynetdicom.status import STATUS_SUCCESS and run pyright type checker.

How to solve
Add to pynetdicom.status.

__all__ = [
    "STATUS_CANCEL",
    "STATUS_FAILURE",
    "STATUS_PENDING",
    "STATUS_SUCCESS",
    "STATUS_UNKNOWN",
    "STATUS_WARNING",
]

I can provide a PR if this change is acceptable.

@scaramallion
Copy link
Member

Yeah, I should probably avoid using the single underscore modules (mostly looks tidier to me that way).

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