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

2020-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is rather a work for linter's and static type checking. Runtime check adds an overhead, and it is expected that in correct program it will always pass. You need the check only while write the program, it may help in debugging. But once it has be

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

2014-01-27 Thread Yury Selivanov
Changes by Yury Selivanov : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2012-06-25 Thread Nick Coghlan
Nick Coghlan 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

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

2012-06-25 Thread Yury Selivanov
Yury Selivanov added the comment: (my previous message edit: no support for 'atexit' - it's implemented in C) -- ___ Python tracker ___ _

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

2012-06-25 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

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

2012-06-25 Thread Yury Selivanov
New submission from Yury Selivanov : With this patch 'contextlib.ExitStack.callback(callback, *args, **kwds)' will validate that the passed callback actually accept the passed '*args' and '**kwds'. P.S. If this patch comes through - I'll create two more issues for 'atexit.register' and 'unitt