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
However, glm_typing considers this an error -- it does not recognize arbitrary sequences as compatible with vec, mat and quat. This was a conscious decision to provide more precise type checking. See:
importglmx=glm.vec3(glm.vec2()) # TypeError
We are unable to create a vec3 from a smaller vec2. If arbitrary sequences were allowed in the vec3 constructor, then glm_typing would not detect this error (since all vecs are also sequences). This intersection between the PyGLM types and Sequence causes this issue.
It's worth noting that tuples of non-arbitrary size are still accepted properly (since their shape is known statically).
It is probably possible to allow the sequence behavior with a mypy plugin, but I've not felt the need for it. Let me know in this issue if it's something you'd need.
The text was updated successfully, but these errors were encountered:
PyGLM
often accepts appropriately composed sequences asvec
,mat
orquat
types.However,
glm_typing
considers this an error -- it does not recognize arbitrary sequences as compatible withvec
,mat
andquat
. This was a conscious decision to provide more precise type checking. See:We are unable to create a
vec3
from a smallervec2
. If arbitrary sequences were allowed in thevec3
constructor, thenglm_typing
would not detect this error (since allvec
s are also sequences). This intersection between thePyGLM
types andSequence
causes this issue.It's worth noting that
tuple
s of non-arbitrary size are still accepted properly (since their shape is known statically).It is probably possible to allow the sequence behavior with a
mypy
plugin, but I've not felt the need for it. Let me know in this issue if it's something you'd need.The text was updated successfully, but these errors were encountered: