Hi Graham,
If you use a tuple rather than a list, the check for existence should
work:
if (0x009, 0x1040) in ds:
...
That's because Datasets's __contains__ (called by "in") will try to
make a Tag object from the argument before doing the check -- Tag
accepts tuples (or a single number like 0x0091040) but not lists (I
suppose that little wrinkle could be fixed).
And to remove data elements completely (if you wish) rather than
blanking them, you can use python's del. I recently added some info on
that to the PydicomUserGuide wiki page.