mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Allow functools.partial in is_simple_callable check
This commit is contained in:
parent
0e9fcd19ea
commit
7166c35a87
|
@ -4,6 +4,7 @@ import collections
|
||||||
import copy
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
import decimal
|
import decimal
|
||||||
|
import functools
|
||||||
import inspect
|
import inspect
|
||||||
import re
|
import re
|
||||||
import uuid
|
import uuid
|
||||||
|
@ -54,7 +55,7 @@ if six.PY3:
|
||||||
"""
|
"""
|
||||||
True if the object is a callable that takes no arguments.
|
True if the object is a callable that takes no arguments.
|
||||||
"""
|
"""
|
||||||
if not (inspect.isfunction(obj) or inspect.ismethod(obj)):
|
if not (inspect.isfunction(obj) or inspect.ismethod(obj) or isinstance(obj, functools.partial)):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
sig = inspect.signature(obj)
|
sig = inspect.signature(obj)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user