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
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 in isinstance(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 ?
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>
…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>
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: