Curtis, or should I say FunkyBob, raised the issue here:
https://github.com/django/django/pull/5226
Currently we have several different signatures:
def __get__(self, instance, instance_type=None)
def __get__(self, obj, type=None):
def __get__(self, instance, type=None)
def __get__(self, obj, objtype)
def __get__(self, instance, owner)
and the Python docs don't seem to have a single preference.
Curtis proposed:
"""
* "instance_type" is explicit
* "cls" is a common convention for passing a class
* "owner" is in the docs {but so are others}
* and "type" I think is a bit confusing...
So... my preference, upon reflection, would be: def __get__(self, instance, cls=None):
"""
For set, it's mostly: def __set__(self, instance, value)
but a couple times: def __set__(self, obj, value)
Do you think it's worth trying to be consistent or not?