Hello, I'll give an example: def func(param="default"): ... def func_wrapper(..., param="default"): ... func(param) We have to duplicate value of parameter "default" if we want to use this as the default. Or we can do that: def func(param="default"): ... def func_wrapper(..., *args): ... func(*args) But it won't always be possible. In addition, auto-completion in IDEs won't work. It would be cool to have an empty type like Void (not None) for explicit full control: def func(param="default"): ... def func_wrapper(..., param=Void): ... func(param)
It's unclear to me what `Void` is meant to provide in your example. Is your hope for a `Void` value to not be passed as a parameter to the wrapped function? On Sun, 2022-07-24 at 17:55 +0000, Крупенков Михаил wrote:
Hello, I'll give an example:
def func(param="default"): ...
def func_wrapper(..., param="default"): ... func(param)
We have to duplicate value of parameter "default" if we want to use this as the default. Or we can do that:
def func(param="default"): ...
def func_wrapper(..., *args): ... func(*args)
But it won't always be possible. In addition, auto-completion in IDEs won't work. It would be cool to have an empty type like Void (not None) for explicit full control:
def func(param="default"): ...
def func_wrapper(..., param=Void): ... func(param) _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@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/R464MU... Code of Conduct: http://python.org/psf/codeofconduct/
participants (2)
-
Paul Bryan
-
Крупенков Михаил