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
Python document says there is unary plus operator in python. It's equivalent to operator.pos, and it's function can be overrided by implementing magic method __pos__.
While it's hard to find any real usage of unary plus operator, making (+) accept both 1 and 2 arguments is symmetric to (-), which can be operator.neg with 1 argument or operator.sub with 2 arguments.
The text was updated successfully, but these errors were encountered:
Python document says there is unary plus operator in python. It's equivalent to
operator.pos
, and it's function can be overrided by implementing magic method__pos__
.While it's hard to find any real usage of unary plus operator, making
(+)
accept both 1 and 2 arguments is symmetric to(-)
, which can beoperator.neg
with 1 argument oroperator.sub
with 2 arguments.The text was updated successfully, but these errors were encountered: