You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
If the items parameter of the hset or hmset method is used in conjunction with the key and value, or with the mapping parameters, the list passed to the items parameter is unexpectedly mutated.
Version: redis-py 5.0.1 (Any Redis version)
Platform: Any platform
Description:
If the
items
parameter of thehset
orhmset
method is used in conjunction with thekey
andvalue
, or with themapping
parameters, the list passed to theitems
parameter is unexpectedly mutated.For example, using the code below:
After the method call,
items
is expectantly updated to['one', b'1', 'two', b'2', 'three', b'3', 'four', b'4']
.Calling the method should, in principle, not change any of the objects sent as parameters.
As a suggestion, the code could be changed to:
This would have the added benefit of allowing
items
to be any kind ofIterable
object and not just lists.(In the same vein of ideas, the
mapping
parameter could be changed totyping.Mapping
to allow any mapping instead of just dicts)The text was updated successfully, but these errors were encountered: