-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Fix is_simple_callable py3k compatibility #4510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
rest_framework/fields.py
Outdated
| True if the object is a callable that takes no arguments. | ||
| """ | ||
| if not hasattr(inspect, 'signature'): | ||
| return py2k_is_simple_callable(obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we branch by version and have two differing definations of is_simple_callable? That'd match the style we use elsewhere in this module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean six.PY3? There is actually a problem with python 3.2, which doesn't have signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe drop python 3.2 support since Django 1.8 has dropped support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This would make the six.PY3 check valid)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be very happy to do so yup. Let's defer brining it in til 3.5 tho' (Not too far off right now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code has been updated/rebased. Let me know if there's anything else I can do.
76e53e8 to
7a0f8f1
Compare
7a0f8f1 to
c764b09
Compare
c764b09 to
b3afcb2
Compare
|
Looks great! We'll probably start a 3.5 branch in the next week or two and get this pulled in then. |
|
Merged into the 3.5 branch, in #4525. Thanks! |
Supersedes and closes #4508. Also fixes, #4506.