diff options
| author | Tim Graham <timograham@gmail.com> | 2019-02-04 20:22:44 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-02-05 13:00:15 -0500 |
| commit | 3004d7057f2798c348e263d5d902eeb1e20464d5 (patch) | |
| tree | 609ec03ad04a5942a7504c32252b0753eb6b4adf | |
| parent | 9a750cbd5c2a003c5680ab049c39ef3de218f5ce (diff) | |
Refs #27753 -- Removed django.utils.functional.curry().
| -rw-r--r-- | django/utils/functional.py | 9 | ||||
| -rw-r--r-- | 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 ------------- |
