[issue33265] contextlib.ExitStack abuses __self__

2018-04-13 Thread Nick Coghlan
Nick Coghlan added the comment: Classifying this as a minor performance enhancement, since methods are much simpler objects than full Python level closures. Thanks! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: ->

[issue33265] contextlib.ExitStack abuses __self__

2018-04-13 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 23ab5ee667a9b29014f6f7f01797c611f63ff743 by Nick Coghlan (jdemeyer) in branch 'master': bpo-33265: use an actual method instead of a method-like function in ExitStack (GH-6456)

[issue33265] contextlib.ExitStack abuses __self__

2018-04-12 Thread Yury Selivanov
Yury Selivanov added the comment: Yep, I think this is a good fix! -- ___ Python tracker ___

[issue33265] contextlib.ExitStack abuses __self__

2018-04-12 Thread Nick Coghlan
Nick Coghlan added the comment: Yury, could you double check the async exit stack change in the PR? I think it's fine since the bound method just passes back the underlying coroutine and the tests all still pass, but a second opinion would be good :) -- nosy:

[issue33265] contextlib.ExitStack abuses __self__

2018-04-12 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list

[issue33265] contextlib.ExitStack abuses __self__

2018-04-11 Thread Jeroen Demeyer
Change by Jeroen Demeyer : -- keywords: +patch pull_requests: +6151 stage: -> patch review ___ Python tracker ___

[issue33265] contextlib.ExitStack abuses __self__

2018-04-11 Thread Jeroen Demeyer
New submission from Jeroen Demeyer : In contextlib, there is code which roughly looks like def _exit_wrapper(exc_type, exc, tb): return cm_exit(cm, exc_type, exc, tb) _exit_wrapper.__self__ = cm This creates a new function _exit_wrapper from a