-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
src/unit_api/__init__.py
Outdated
# debatable whether this should be standardised | ||
def __rlshift__[V](self, other: V) -> Quantity[V, Self]: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a little lost as to the benefit of <<. In both those cases you can use u.Quantity(q, unit) and it does the same thing (maybe with copy=False), but for a new user seeing Quantity() is much clearer. With <<, I must find how what the << operator is (many users won't have used it before), realise astropy's made a custom implementation for it and find the docs for it. Is this worth it to save a few characters? I'm unsure.
from astropy/quantity-2.0#23 (comment), there was no futher discussion in that thread.
I haven't seen a compelling reason to standardise it.
@property | ||
def dimension(self) -> Dimension: ... | ||
|
||
def __mul__(self, other: Self, /) -> Self: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need the reflected operators, right?
Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
* add reverse ops * remove rlshift * Update src/unit_api/__init__.py --------- Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
incorporated into https://github.com/quantity-dev/metrology-apis |
No description provided.