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

Cleanup classes namespace and repr #427

Merged
merged 8 commits into from
Nov 20, 2023
Merged

Cleanup classes namespace and repr #427

merged 8 commits into from
Nov 20, 2023

Conversation

almarklein
Copy link
Member

The wgpu.base module that defined the classes is technically public API, but that module contains a lot of stuff that we need to define the classes. This PR cleans that up. It's a bit nit-picky but hey, look how tidy things look!

  • Renames "base.py" to "_classes.py".
  • Creates "classes.py", a public namespace that contains just the classes, similar to how we have wgpu.enums and wgpu.flags.
  • The repr of the classes lists the public namespace where the object is loaded from, omitting the private module (e.g. <wgpu.GPUDevice ..> or <wgpu.backends.wgpu_native.GPUDevice ..>).

@almarklein almarklein requested a review from Korijn as a code owner November 18, 2023 23:34
@almarklein almarklein merged commit 257143a into main Nov 20, 2023
18 checks passed
@almarklein almarklein deleted the classes branch November 20, 2023 09:27
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

Successfully merging this pull request may close these issues.

2 participants