Have the `__rdiv __ ()` and `__idiv__` operators changed in Python 3.x?

In Python 3.x, the operator is __div__() deprecated in favor of __floordiv__() and __truediv__().

Are operators __rdiv__()also used __idiv__()to access versions __truediv__()in the reverse order and in place? If so, what are the operator names for the inverse and local versions __floordiv__()?

+4
source share
1 answer

__rdiv__and __idiv__no longer exists. The new names are an obvious choice __rtruediv__, __itruediv__, __rfloordiv__and __ifloordiv__, following a standard format. This can be seen in the link in the second answer to the question you linked, or doing dir(int)in the Python 3 interpreter.

+4
source

Source: https://habr.com/ru/post/1620637/


All Articles