Wow, I really could have sworn that only a few days ago the api specifically said one or the other, puts or deletes, but not intermingled. I even wrote xor in the docstring. Since it's and/or now (or always was and I just read it wrong) your suggestion obviously makes much more sense.