On Tue, Sep 11, 2018 at 9:34 PM, Steven D'Aprano <st...@pearwood.info> wrote: > I think that __params__ as an implicitly created local variable is > just barely justifiable, if you don't care about slowing down all > function calls for the benefit of a tiny number of them. But exposing > that information as an externally visible attribute of the function > object is probably unworkable and unnecessary.
Rather than slowing down ALL function calls, you could slow down only those that use it. The interpreter could notice the use of the name __params__ inside a function and go "oh, then I need to include the bytecode to create that". It'd probably need to be made a keyword, or at least unassignable, to ensure that you never try to close over the __params__ of another function, or declare "global __params__", or anything silly like that. I'm still -1 on adding it, though. ChrisA _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/