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
It would be amazing to be able to specify the shape and units of a Quantity[Array] in type hints, does anyone know if that's possible? I know they're both part of the value and not the type but the two concepts are kinda fungible in Python. I vaguely remember that people somewhere somewhen were working on it.
It would be great to have some really high-quality type hints for Quantity. Ideally, we'd be able to express the dimensions of the quantity, as well as the enclosed type. This would allow units to be checked statically, which would be huge. In a perfect world, NumPy would support type hints on arrays that specify their dtype and shape, but maybe if they drag on that we can do something for Quantity[Array]
This all probably requires PEP 646, which is to be implemented in Python 3.11, so won't be safe for us to use for another couple of years unless someone develops a back-port.
The text was updated successfully, but these errors were encountered:
It would be great to have some really high-quality type hints for
Quantity
. Ideally, we'd be able to express the dimensions of the quantity, as well as the enclosed type. This would allow units to be checked statically, which would be huge. In a perfect world, NumPy would support type hints on arrays that specify their dtype and shape, but maybe if they drag on that we can do something forQuantity[Array]
This all probably requires PEP 646, which is to be implemented in Python 3.11, so won't be safe for us to use for another couple of years unless someone develops a back-port.
The text was updated successfully, but these errors were encountered: