-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Any plan for improving type hint #6404
Labels
question
Question on using Taichi
Comments
Hi, you are welcome to contribute! The suggestions for these examples are very valuable. Let me explain why |
neozhaoliang
pushed a commit
that referenced
this issue
Nov 16, 2022
Issue: #6404 ### Brief Summary This PR doesn't solve the issue in #6404 but it helps a bit for beginners. Our type hint isn't perfect yet, but it should at least work for the python apis. ;) Adding a faq so that users can find them. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
quadpixels
pushed a commit
to quadpixels/taichi
that referenced
this issue
May 13, 2023
…6621) Issue: taichi-dev#6404 ### Brief Summary This PR doesn't solve the issue in taichi-dev#6404 but it helps a bit for beginners. Our type hint isn't perfect yet, but it should at least work for the python apis. ;) Adding a faq so that users can find them. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using vscode with pylance. Autocomplete and typehint almost won't work..
Are there any one are current working on this? Or should I create a PR to fix some of these problems?
Several examples.
Example 1
PyLance cannot figure out what does
VectorType
stand for..Example 2
possible fix for example 1&2: I found these problems are fixed after I add some import statement in __init__.py.
Example 3
ti.math.vec2(1, 2).x
is valid. But no completion is provided.possible fix: provide special type hint for vec2, vec3, vec4, ivec2, ivec3, etc..
Example 4
though
ti.math.vec2
can be used as type when define a taichi struct, but it cannot be used inisinstance(ti.math.vec2(1, 2), ti.math.vec2)
because it is not a real python type.possible fix: How about make
ti.types
types real types inside C code ?Example #5
when i try to access a member variable of a object of classes decorated by
@ti.dataclass
, no auto completion is provided.possible fix: PEP 681
The text was updated successfully, but these errors were encountered: