We have django.utils.deprecation.RenameMethodsBase to help with that, but
now I see that subclasses have this signature, `def has_key(self, key,
version=None)`, so it doesn't seem the method can be replaced with
On Sunday, January 31, 2016 at 4:26:12 AM
Might be problematic for third-party cache backends which implement
*has_key* and rely on *__contains__* calling it - don't see how you can
show the warning in that case.
On Saturday, January 30, 2016 at 12:34:14 PM UTC, Tim Graham wrote:
> Yes, but dict.has_key() is removed in Python 3. If
Yes, but dict.has_key() is removed in Python 3. If we started the
deprecation in Django now, it would be scheduled for removal in Django 2.0
which also drops support for Python 2.
On Friday, January 29, 2016 at 8:04:33 PM UTC-5, Curtis Maloney wrote:
> Isn't this so it complies with the dict
Isn't this so it complies with the dict interface? True, it's discouraged now,
but it's still there.
On 30 January 2016 10:42:12 am LHDT, Tim Graham wrote:
>Also the template BaseContext class has an undocumented has_key()
>wonder if that can be removed
Also the template BaseContext class has an undocumented has_key() method. I
wonder if that can be removed without a deprecation?
On Friday, January 29, 2016 at 6:11:54 PM UTC-5, Tim Graham wrote:
> Any opposition to deprecating Cache.has_key()? Cache
Any opposition to deprecating Cache.has_key()? Cache already implements
__contains__() so converting has_key() to "in" can be done with existing
versions of Django. Anyone using flake8 will get a warning about has_key()
usage: W601 .has_key() is deprecated, use 'in'.
You received this