Jack Bates wrote: > i have a domish element - when i try the following, > >>>> message = element >>>> del message['from'] >>>> element['from'] > > - i get a key error
Well, yes. That's how python works ;o) > > to avoid this key error, i think i want to copy the element, so i can > drop the 'from' attribute from one copy without affecting the other? > > but i didn't find anything to make a copy in the domish element api I haven't tried it, but have you tried the python standard copy protocol: import copy message = copy.deepcopy(element) _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python