-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
bugThe problem described is something that must be fixedThe problem described is something that must be fixed
Description
Originally posted by acampove September 22, 2025 in #640
This is the MWE
import vector
from vector import MomentumObject3D
def _fun(vec : MomentumObject3D) -> None:
print(vec)
vec = vector.obj(pt=1.0, eta=1.0, phi=1.0, mass=10)
v3d = vec.to_Vector3D()
_fun(vec=v3d)save it, run pyright/mypy test.py and you will see:
(rx) [acampove@thinkbook vector]$ pyright test.py
WARNING: there is a new pyright version available (v1.1.404 -> v1.1.405).
Please install the new version or set PYRIGHT_PYTHON_FORCE_VERSION to `latest`
/home/acampove/Tests/vector/test.py
/home/acampove/Tests/vector/test.py:10:10 - error: Argument of type "VectorProtocolSpatial" cannot be assigned to parameter "vec" of type "MomentumObject3D" in function "_fun"
"VectorProtocolSpatial" is not assignable to "MomentumObject3D" (reportArgumentType)
1 error, 0 warnings, 0 informations
Metadata
Metadata
Assignees
Labels
bugThe problem described is something that must be fixedThe problem described is something that must be fixed