Here's a breakdown of the specific formatting syntax. With the str.format method you can fill-in placeholders in the given string instance that are of the form {...}. These work with positional arguments in the following way:
>>> '{}:{}'.format(1, 2)
'1:2'
>>> '{0}:{1}'.format(1, 2)
'1:2'
>>> '{1}:{0}'.format(1, 2)
'2:1'
That means you can specify the number of the positional argument inside the curly braces. The string can refer to a positional argument multiple times:
>>> '{0}:{1}:{0}'.format(1, 2)
'1:2:1'
Using .x notation let's you access attributes of that argument. For example:
>>> class Test:
... x = 1
... y = 2
...
>>> '{0.x}:{0.y}'.format(Test)
'1:2'
Using !r you can force to use the __repr__ of that object rather than the __str__. For example:
>>> class Test:
... def __str__(self):
... return '__str__'
... def __repr__(self):
... return '__repr__'
...
>>> '{0}'.format(Test())
'__str__'
>>> '{0!s}'.format(Test())
'__str__'
>>> '{0!r}'.format(Test())
'__repr__'
So combining all this information we get the following:
'Point({0.x!r}, {0.y!r})'.format(self)
Here a format string with two placeholders is defined ({0.x!r} and {0.y!r}). They should be filled in with the first positional argument's x and y attributes (recall that {0} will be substituted with the first argument, so {0.x} requests the x attribute of that argument). And finally the !r requests the __repr__ of that object rather than the __str__ (which is the default).
The same reasoning applies to the __str__ method.
By the way, the formatting syntax also allows keyword arguments and they can be referred to by their name:
>>> '{first}:{second}'.format(first=1, second=2)
'1:2'
>>> '{second}:{first}'.format(first=1, second=2)
'2:1'