0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Explained the pattern for special methods compatibility.

This commit is contained in:
Aymeric Augustin 2013-04-19 09:53:19 +02:00
parent 5306285ce2
commit bfe25de429

View File

@ -317,6 +317,9 @@ Division
def __idiv__(self, other): # Python 2 compatibility
return type(self).__itruediv__(self, other)
Special methods are looked up on the class and not on the instance to reflect
the behavior of the Python interpreter.
.. module: django.utils.six
Writing compatible code with six