
Oct. 25, 2021
6:08 p.m.
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.