[issue15185] Validate callbacks in 'contextlib.ExitStack.callback()'

Nick Coghlan report at bugs.python.org
Tue Jun 26 03:02:41 CEST 2012


Nick Coghlan <ncoghlan at gmail.com> added the comment:

I'm not comfortable adding a dependency on inspect to the contextlib module, and I think it would be undesirable to have too many cases where the early validation is silently skipped.

While I like the idea of adding early signature validation to these APIs in principle, given the above concerns and the fact this probably crosses the line into "feature" territory, I think we want to wait until 3.4 and the introduction of a mechanism that adds introspection support to callables implemented in C.

That will likely involve moving the signature support somewhere lower in the module stack (perhaps to a private "_signature" module, with inspect remaining the official API), and will reduce the number of cases where pre-validation is skipped.

----------
versions: +Python 3.4 -Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15185>
_______________________________________


More information about the Python-bugs-list mailing list