Kaydet (Commit) bfe25de4 authored tarafından Aymeric Augustin's avatar Aymeric Augustin

Explained the pattern for special methods compatibility.

üst 5306285c
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment