[issue44123] make function parameter sentinel value true singletons

Tal Einat report at bugs.python.org
Fri May 14 12:41:16 EDT 2021


Tal Einat <taleinat+python at gmail.com> added the comment:

> I do not understand the problem with pickling sentinel values used as default values for function parameters. Could you please show an example?

A category of relevant uses I can think of is when wrapping a function and storing the parameters it was called with for some later use. Some examples of this are logging, caching and RPC.

Specifically for RPC, using pickle to serialize/deserialize the parameters and then call the function with them seems reasonable. RPyC[1] does this in some cases, though I haven't yet checked how it handles these kinds of sentinel objects specifically.

I'll try to find a good concrete example.

[1] https://rpyc.readthedocs.io/

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44123>
_______________________________________


More information about the Python-bugs-list mailing list