On Fri, Jul 20, 2018 at 5:41 PM, Steven D'Aprano <steve@pearwood.info> wrote:
What makes you think that a built-in deferred feature won't have exactly the same issues? Do you have an implementation that doesn't need to do intraspection?
I don't know about these low level things, but I assume it'd be implemented in C and wouldn't have the same cost as entering a new function in Python. I imagine it just being a small modification of the mechanism that Python already uses to assign values to arguments when a function is called. Is that not the case? On Fri, Jul 20, 2018 at 5:41 PM, Steven D'Aprano <steve@pearwood.info> wrote:
On Fri, Jul 20, 2018 at 04:43:56PM +0200, Peter O'Connor wrote:
I still think it would be nice to have this as a built-in python feature, for a few reasons: - When using non-differable functions (say in other codebases), we have to do a bunch of "func = deferrable_args(func)" at the top of the module (or we can just do them at runtime, but then we're doing inspection every time, which is probably slow). - It adds a layer to the call stack for every deferrable function you're in. - To avoid annoying errors where you've defined an arg as deferred but forgot to wrap the function in question.
What makes you think that a built-in deferred feature won't have exactly the same issues? Do you have an implementation that doesn't need to do intraspection?
-- Steve _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/