Skip to content

Ensure for 3rd-party imports we only import packages and modules #637

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
leofang opened this issue May 14, 2025 · 0 comments
Open

Ensure for 3rd-party imports we only import packages and modules #637

leofang opened this issue May 14, 2025 · 0 comments
Assignees
Labels
cuda.bindings Everything related to the cuda.bindings module cuda.core Everything related to the cuda.core module enhancement Any code-related improvements P1 Medium priority - Should do triage Needs the team's attention

Comments

@leofang
Copy link
Member

leofang commented May 14, 2025

I think we should just import pywintypes and then use it explicitly like except pywintypes.error as e:. I agree it is very unclear (and I did not know error is a legit exception type).

Originally posted by @leofang in #625 (comment)

I like Google's Python style guide on this part:
https://google.github.io/styleguide/pyguide.html#22-imports

Use import statements for packages and modules only, not for individual types, classes, or functions.

@github-actions github-actions bot added the triage Needs the team's attention label May 14, 2025
@leofang leofang added enhancement Any code-related improvements P1 Medium priority - Should do cuda.bindings Everything related to the cuda.bindings module cuda.core Everything related to the cuda.core module labels May 14, 2025
@rwgk rwgk self-assigned this May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda.bindings Everything related to the cuda.bindings module cuda.core Everything related to the cuda.core module enhancement Any code-related improvements P1 Medium priority - Should do triage Needs the team's attention
Projects
None yet
Development

No branches or pull requests

2 participants