mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 04:20:12 +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 datetime
|
||||
import decimal
|
||||
import functools
|
||||
import inspect
|
||||
import re
|
||||
import uuid
|
||||
|
@ -54,7 +55,7 @@ if six.PY3:
|
|||
"""
|
||||
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
|
||||
|
||||
sig = inspect.signature(obj)
|
||||
|
|
Loading…
Reference in New Issue
Block a user