You can easily achieve this with something like
Void = object()
def func(param=Void):
if param is Void:
param = "default"
or in the wrapper:
Void = object()
def wrapper(param=Void, **kwargs):
if param is not Void:
kwargs["param"] = param
return func(**kwargs)
With some extra work, you can even create a decorator to handle this
automatically.
On 25/07/2022 11:39, Михаил Крупенков wrote:
Yes, I want that when Void is received in a function parameter it is
not processed:
func(Void) == func() == "default"
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/XDRPPSQ2AVDCDDQQFXH772XGOK5Q7NE4/
Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/O4WTBMOWZWOQTZCTHGEHFV3AVQJG45JZ/
Code of Conduct: http://python.org/psf/codeofconduct/