Message393724
> And what you need is just to not pass to the wrapped function arguments which were not passed to wrapper. *args and **kwargs do not contain arguments which were not passed.
It's common for wrapper functions to mirror the defaults of the wrapped functions and pass those along... A quick search brings up an example from dataclasses where sentinel values are passed as arguments to a wrapped callable[1].
I concede that issues with pickling such values are very unlikely. I stumbled upon such an issue once and it was difficult to debug, but that was a very unusual circumstance.
Still, it's a bit surprising that we have public facing values in stdlib modules which don't behave as one would expect with regard to pickling. This is why I created this
It seems that I should have marked this as "enhancement" rather than the default of "behavior", though, since I meant this to be an improvement on the current situation, rather then assert the current situation is "broken".
[1] https://github.com/python/cpython/blob/c10c2ec7a0e06975e8010c56c9c3270f8ea322ec/Lib/dataclasses.py#L346 |
|
Date |
User |
Action |
Args |
2021-05-15 19:23:47 | taleinat | set | recipients:
+ taleinat, rhettinger, vstinner, eric.smith, zach.ware, serhiy.storchaka, iritkatriel |
2021-05-15 19:23:47 | taleinat | set | messageid: <1621106627.42.0.852142205975.issue44123@roundup.psfhosted.org> |
2021-05-15 19:23:47 | taleinat | link | issue44123 messages |
2021-05-15 19:23:47 | taleinat | create | |
|