> I'm not sure why, but marshal does dump the 2 differently. ie: > > >>> marshal.dumps(str(123)) > 's\x03\x00\x00\x00123' > > >>> marshal.dumps(str("123")) > 't\x03\x00\x00\x00123' >
I've just checked the source [1]. 's' refers to a regular string, 't' refers to an interned[2] string. In other words the difference between the 2 marshal dumps is an internal python implementation detail. You probably shouldn't be comparing marshal dumps in your app in the first place. [1] http://coverage.livinglogic.de/Python/marshal.c.html. (Actually, I checked the downloaded bz2, but this is the only URL for marshal.c I could find) [2] http://mindprod.com/jgloss/interned.html -- http://mail.python.org/mailman/listinfo/python-list