Message269071
Nick,
My use case is an issue of backwards compatibility and multiple Python version support for a library that makes prolific use of the legacy argspec (args, varargs, varkw, defaults) namedtuple, *including* the bound self argument behavior. argspec and signature are quite different, and supporting a Py26-Py36 codebase that handles both simultaneously seemed like quite a burden, so I opted to write a compatibility shim that returned an Argspec-like object for all versions of Python; this seemed the simplest approach to bridge the gap in a codebase that supports Python 2.6 through 3.6, and it's the approach that I've seen other major libraries (like Django) take:
https://github.com/pecan/pecan/pull/61
I'm using a similar approach to Python 3.5's getfullargspec() implementation:
https://github.com/python/cpython/blob/3.5/Lib/inspect.py#L1069
...but I don't have a long-term public API for doing it (so I have to rely on the private inspect._signature_from_callable call, which seems icky). |
|
Date |
User |
Action |
Args |
2016-06-22 12:08:34 | ryan.petrello | set | recipients:
+ ryan.petrello, ncoghlan, SilentGhost, eric.snow, yselivanov |
2016-06-22 12:08:34 | ryan.petrello | set | messageid: <1466597314.59.0.950925946316.issue27172@psf.upfronthosting.co.za> |
2016-06-22 12:08:34 | ryan.petrello | link | issue27172 messages |
2016-06-22 12:08:34 | ryan.petrello | create | |
|