Sunday, June 7, 2009

Unicode Gotcha

What will this give you?

>>> astring = None
>>> print unicode(astring)

If you said None then you will be surprised to find the answer is u"None" which is not at all the same thing. Really messed up my day..

No comments: