Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Deprecated getargspec #415
This also introduces a backwards-incompatible change in how method signatures are handled. Currently, the following test passes:
class F3(object): def __call__(self, foo, bar): pass f3 = F3() for func in [f1, f2, f3]: assert utils.get_func_args(func) == ['self', 'foo', 'bar']
Not sure what the best solution is. This will require more thought.
I looked into supporting Py2/3 compatibility. It is far from trivial.
I wanted to replicate the behavior of
Replicating the behavior of
Looking at the source of funcsigs which replicates removing bound methods like
kind = params.kind if kind in (_POSITIONAL_OR_KEYWORD, _POSITIONAL_ONLY): # Drop first parameter: # '(p1, p2[, ...])' -> '(p2[, ...])' params = params[1:]
In summary, providing compatibility between Python 2 and 3 requires back porting a non-trivial amount of the
referenced this pull request
May 27, 2016
I have a reasonably simple fallback for Python 2 working. I opened a PR against iiogmgo/deprecated-getargspec.
This is basically the same strategy used in the Django PR, but with additional handling for bound methods.
It really should. Consider how this utility is being used currently.
That logic is currently invalid for bound methods, because including
I added a test to the PR for providing a bound method with one unbound parameter as the serializer for a
Thanks @deckar01 for looking into this. I'm thinking that the best solution might be to change the behavior of
This would happen in marshmallow 3.0, since it's a breaking change.