From 3004d7057f2798c348e263d5d902eeb1e20464d5 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 4 Feb 2019 20:22:44 -0500 Subject: [PATCH] Refs #27753 -- Removed django.utils.functional.curry(). --- django/utils/functional.py | 9 --------- docs/releases/3.0.txt | 3 +++ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/django/utils/functional.py b/django/utils/functional.py index 6118c108ef..ab0be502ce 100644 --- a/django/utils/functional.py +++ b/django/utils/functional.py @@ -4,15 +4,6 @@ import operator from functools import total_ordering, wraps -# You can't trivially replace this with `functools.partial` because this binds -# to classes and returns bound instances, whereas functools.partial (on -# CPython) is a type and its instances don't bind. -def curry(_curried_func, *args, **kwargs): - def _curried(*moreargs, **morekwargs): - return _curried_func(*args, *moreargs, **{**kwargs, **morekwargs}) - return _curried - - class cached_property: """ Decorator that converts a method with a single self argument into a diff --git a/docs/releases/3.0.txt b/docs/releases/3.0.txt index 97ada26838..19361cc195 100644 --- a/docs/releases/3.0.txt +++ b/docs/releases/3.0.txt @@ -271,6 +271,9 @@ Django 3.0, we're removing these APIs at this time. * ``django.utils.encoding.python_2_unicode_compatible()`` - Alias of ``six.python_2_unicode_compatible()``. +* ``django.utils.functional.curry()`` - Use :func:`functools.partial` or + :class:`functools.partialmethod`. See :commit:`5b1c389603a353625ae1603`. + Miscellaneous -------------