PxXB should allow to assign `None` to optional elements and attributes
Brought to you by:
pabigot
Optional attributes return None on access to indicate that the attribute is missing. However, when one tries to assign None to an optional attribute, this can result in:
Module pyxb.binding.basis, line 62, in __setattr__
Module pyxb.binding.content, line 410, in set
AssertionError
This can make assigning attributes quite complicated, especially if one creates one binding object from another one. Instead of "dest.attr = "src.attr" one must use code "if src.attr is not None: dest.attr = src.attr".
commit bbeea8f212a3e3b9a5c42cd2171970e3e20fc113
Author: Peter A. Bigot <pabigot@…>
Date: Sat Feb 25 10:02:56 2012 -0600