You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, something that has bothered me for a while now:
Some of the functions that return a different object, such as GPUDevice.create_command_encoder() returns a GPUCommandEncoder. So is there any issue with providing this type annotation in general? I only played around with a few manual examples. (I can look into code gen improvements to add that, time permitting).
The main point being that in the editor I am always worried about white text for methods. And I also can't easily jump to the definition to check the arguments needed... lot's of ctrl+F
I have been using the following pattern
which gives me the unimplemented function in _classes.py which as least as a docstring and the args. But getting to the actual version in wgpu_native/_api.py would be even more helpful.
So more like a question to the other devs, do you have a editor based solution or some other trick?
The text was updated successfully, but these errors were encountered:
Personally, I often work in an interactive environment (Pyzo), and I would simply create the encoder so its a life object that the IDE can then inspect. Or I 'enter' a running program with a well-placed breakpoint() call and inspect from there.
That said, support for static analysis can indeed be improved. We do have annotations for arguments for a while, but return types have not been implemented yet. It would be great if we did!
I'm not sure what we can do to make it easier to jump to the implementation in wgpu_native/_api.py. I just type e.g. def create_xx in the VSCode search panel.
Hey, something that has bothered me for a while now:
Some of the functions that return a different object, such as
GPUDevice.create_command_encoder()
returns aGPUCommandEncoder
. So is there any issue with providing this type annotation in general? I only played around with a few manual examples. (I can look into code gen improvements to add that, time permitting).The main point being that in the editor I am always worried about white text for methods. And I also can't easily jump to the definition to check the arguments needed... lot's of ctrl+F
I have been using the following pattern
which gives me the unimplemented function in
_classes.py
which as least as a docstring and the args. But getting to the actual version inwgpu_native/_api.py
would be even more helpful.So more like a question to the other devs, do you have a editor based solution or some other trick?
The text was updated successfully, but these errors were encountered: