mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-07 13:54:47 +03:00
Coment t o show whihc python version is statement for
This commit is contained in:
parent
610e8ca75c
commit
14c22bcab3
|
@ -140,10 +140,10 @@ def value_from_object(field, obj):
|
||||||
return field.value_from_object(obj)
|
return field.value_from_object(obj)
|
||||||
|
|
||||||
|
|
||||||
def getargspec(obj): # type: tuple
|
def getargspec(obj):
|
||||||
if not hasattr(inspect, 'signature'):
|
if not hasattr(inspect, 'signature'): # Python 2.7 - 3.2
|
||||||
parameters, _, _, defaults = inspect.getargspec(obj)
|
parameters, _, _, defaults = inspect.getargspec(obj)
|
||||||
else:
|
else: # Python +3.3
|
||||||
signature = inspect.signature(obj)
|
signature = inspect.signature(obj)
|
||||||
parameters = signature.parameters
|
parameters = signature.parameters
|
||||||
defaults = [i for i in parameters if i.default != inspect._empty]
|
defaults = [i for i in parameters if i.default != inspect._empty]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user