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
I'm doing an update that is completely meaningless when the key doesn't already exist. I don't even want to use a default value. I just want to leave the key nonexistent. I know I can first see if get_in() is not None, but an option to disable upsert seems too natural to not have in an update function.
The text was updated successfully, but these errors were encountered:
@fenom I agree. The correct place to disable upserts is by subclassing dict and replacing its update method to disable upserts. Then you would pass your new subclass using the factory=MySubclass keyword argument. dicttoolz.update_in essentially delegates to the update method of the mapping container.
I'm doing an update that is completely meaningless when the key doesn't already exist. I don't even want to use a default value. I just want to leave the key nonexistent. I know I can first see if get_in() is not None, but an option to disable upsert seems too natural to not have in an update function.
The text was updated successfully, but these errors were encountered: