thoughts on backporting __wrapped__ to 2.7?

I'm working on teaching funcsigs - the backport of inspect.signature - better handling for wrapped functions, and the key enabler to do that is capturing the wrapped function in __wrapped__. I'm wondering what folks thoughts are on backporting that to 2.7 - seems cleaner than monkeypatching functools.wraps, which would tend to be subject to import ordering races and general ick. I'll likely prep such a monkeypatch for folk that are stuck on older versions of 2.7 anyhow... so its not a huge win... -Rob -- Robert Collins <rbtcollins@hpe.com> Distinguished Technologist HP Converged Cloud

On 4 April 2016 at 20:04, Robert Collins <robertc@robertcollins.net> wrote:
I'm working on teaching funcsigs - the backport of inspect.signature - better handling for wrapped functions, and the key enabler to do that is capturing the wrapped function in __wrapped__. I'm wondering what folks thoughts are on backporting that to 2.7 - seems cleaner than monkeypatching functools.wraps, which would tend to be subject to import ordering races and general ick. I'll likely prep such a monkeypatch for folk that are stuck on older versions of 2.7 anyhow... so its not a huge win...
Right, the baseline there is really 2.7.5 + selected backports, and the backport set is small for RHEL 7.x, and even smaller for Debian stable and Ubuntu LTS. Even getting the network security enhancements backported has proven to be challenging - other feature updates have next to no chance. Given that, I don't see a compelling reason to change the existing policy - the "no new features in point releases" restriction only gets waived in cases that have implications beyond the Python 2.7 process itself (which pretty much restricts potential waivers to network security enhancements). Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

See https://pypi.python.org/pypi/functools32 for the functools backport for Python 2.7. Victor

Sadly that has the ordering bug of assigning __wrapped__ first and appears a little unmaintained based on the bug tracker :( On 5 Apr 2016 8:10 PM, "Victor Stinner" <victor.stinner@gmail.com> wrote:
See https://pypi.python.org/pypi/functools32 for the functools backport for Python 2.7.
Victor

On 6 April 2016 at 15:03, Stephen J. Turnbull <stephen@xemacs.org> wrote:
Robert Collins writes:
Sadly that has the ordering bug of assigning __wrapped__ first and appears a little unmaintained based on the bug tracker :(
You can fix two problems with one patch, then!
Not really - taking over a project is somewhat long winded; it would be centralising yet another backport which may-or-may-not-be-a-good-thing, and I'm not exactly overflowing with spare tuits. If someone wants to do it - great, more power to them, but the last thing we need is to move it from one unmaintained spot to another unmaintained spot. -Rob -- Robert Collins <rbtcollins@hpe.com> Distinguished Technologist HP Converged Cloud
participants (4)
-
Nick Coghlan
-
Robert Collins
-
Stephen J. Turnbull
-
Victor Stinner