Message375984
Hi,
This is more a question/proposal than a real issue. I apologize in
advance if this has already been debated or if it is not relevant.
I noticed `setdefault` method of mutable mapping objects is returning
the default value as passed in the call, when applicable, without
passing through `__getitem__`.
I think it would be more "symmetric" if it would return the default
value set by `__setitem__` via `__getitem__`. This would handle the
case of a custom MutableMapping defining a custom behaviour of
`__setitem__` and `__getitem__`.
Of course, in my case finally I overloaded `setdefault` to do this,
but it might be worth in general, at least for the MutableMapping
class.
Thanks,
Matias. |
|
Date |
User |
Action |
Args |
2020-08-27 10:28:20 | guijarro | set | recipients:
+ guijarro |
2020-08-27 10:28:20 | guijarro | set | messageid: <1598524100.24.0.553076023684.issue41647@roundup.psfhosted.org> |
2020-08-27 10:28:20 | guijarro | link | issue41647 messages |
2020-08-27 10:28:19 | guijarro | create | |
|