3 ms·
One case where this is very desirable: def spawn_coroutine(func, /, *args, **kwargs): # func can itself have a parameter called 'func' and nothing brea
by mananaysiempre 2y ago
One case where this is very desirable:
def spawn_coroutine(func, /, *args, **kwargs):
# func can itself have a parameter called 'func' and nothing breaks
# we could have the user provide the thunk themselves but that’s inconvenient
def thunk():
return func(*args, **kwargs)
# put thunk on some sort of task queue...
But, as the PEP points out, sometimes you just don’t want the parameter names to be part of your public contract, and it’s nice to have a way to express that.