What is python .. (“dot dot”) notation syntax?

What you have is a float literal without the trailing zero, which you then access the __truediv__method of. It's not an operator in itself; the first dot is part of the float value, and the second is the dot operator to access the objects properties and methods.

You can reach the same point by doing the following.

>>> f = 1.
>>> f
1.0
>>> f.__floordiv__
<method-wrapper '__floordiv__' of float object at 0x7f9fb4dc1a20>

Another example

>>> 1..__add__(2.)
3.0

Here we add 1.0 to 2.0, which obviously yields 3.0.

原文地址:https://www.cnblogs.com/dancesir/p/8241001.html