The named_gate and named_measruement wrappers check the type annotations at runtime. This is undesirable as it is
1) Not Pythonic.
2) Dangerous, there are edge cases were type annotations can be correct by an error is raised ("opensquirrel.ir.Qubit" would be a correct typehint for an Expression, but an error will be raised.)
These checks should be removed and handled by a static type checker like mypy.
The
named_gate
andnamed_measruement
wrappers check the type annotations at runtime. This is undesirable as it is 1) Not Pythonic. 2) Dangerous, there are edge cases were type annotations can be correct by an error is raised ("opensquirrel.ir.Qubit"
would be a correct typehint for anExpression
, but an error will be raised.)These checks should be removed and handled by a static type checker like
mypy
.