This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author taleinat
Recipients eric.smith, iritkatriel, rhettinger, serhiy.storchaka, taleinat, vstinner, zach.ware
Date 2021-05-14.16:41:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1621010476.53.0.235703195984.issue44123@roundup.psfhosted.org>
In-reply-to
Content
> 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/
History
Date User Action Args
2021-05-14 16:41:17taleinatsetrecipients: + taleinat, rhettinger, vstinner, eric.smith, zach.ware, serhiy.storchaka, iritkatriel
2021-05-14 16:41:16taleinatsetmessageid: <1621010476.53.0.235703195984.issue44123@roundup.psfhosted.org>
2021-05-14 16:41:16taleinatlinkissue44123 messages
2021-05-14 16:41:15taleinatcreate