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:
parent
5306285ce2
commit
bfe25de429
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user