On Mon, Oct 25, 2021, 8:20 AM Marc-Andre Lemburg

> If I instead write:
>
> def process_files(processor, files=deferred(os.listdir(DEFAULT_DIR))):
>
> it is pretty clear that something is happening at a different time than
> function definition time :-)
>
> Even better: the deferred() object can be passed in as a value and does
> not have to be defined when defining the function, since the function will
> obviously know what to do with such deferred() objects.
>

Gosh, that EXACTLY what I've been suggesting :-).

Except I don't think 'deferred()' can just be a function as in Marc-André's
example. The arguments would still evaluate too eagerly. I think it needs
syntax or a keyword.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/3IYSPUV7IGVPSEZ4FDVNME6HCQMSEYX2/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to