PyXB elementary data types do not play well with "copy/pickling/..."
Brought to you by:
pabigot
As least some elementary data types cannot be copied/pickled.
>>> from pyxb.binding.datatypes import dateTime
>>> from datetime import datetime
>>> from copy import copy
>>> pdt=dateTime(datetime.utcnow())
>>> pdt
dateTime(2012, 2, 16, 9, 58, 2, 659166)
>>> copy(pdt)
Traceback (most recent call last):
...
File ".../Python-2.4/lib/python2.4/site-packages/pyxb/binding/datatypes.py", line 426, in __new__
ctor_kw.update(cls._LexicalToKeywords(value, cls.__Lexical_re))
File ".../Python-2.4/lib/python2.4/site-packages/pyxb/binding/datatypes.py", line 328, in _LexicalToKeywords
raise BadTypeValueError('Value "%s" not in %s lexical space' % (text, cls._ExpandedName))
BadTypeValueError: Value "� :
�" not in {http://www.w3.org/2001/XMLSchema}dateTime lexical space
commit 241de20cf735ffe9eb49bec48da5e2157876e8e8
Author: Peter A. Bigot <pabigot@…>
Date: Sat Feb 25 14:48:45 2012 -0600