Hello!
i stumbled on this when trying to stock away an h8 instance for later
use, specifically via repr() and then eval(). However doing a repr() of
an h8 instance gives the same as a repr() of a unicode instance. The
following interactive session maybe shows this more clearly:
$ python
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from qpy import h8
>>> x = h8('<xml>some xml string</xml>')
>>> x
u'<xml>some xml string</xml>'
>>> repr(x)
"u'<xml>some xml string</xml>'"
>>> y = eval(repr(x))
>>> y
u'<xml>some xml string</xml>'
>>> y == x
True
>>> y.__class__, x.__class__
(<type 'unicode'>, <type 'qpy.c8.h8'>)
>>>
What should repr() of an h8 instance give?
mario
_______________________________________________
QP mailing list
[email protected]
http://mail.mems-exchange.org/mailman/listinfo/qp