[issue1308] unicode(None) anomaly

2007-10-21 Thread James G. sack (jim)
James G. sack (jim) added the comment: Martin v. Löwis wrote: > Martin v. Löwis added the comment: > > Ok. This is not a bug, but by design. unicode(X)==unicode(str(X)) for > most things, and str(X)==repr(X) for most things. repr(None)=='None', > hence the result you see. Closing as invalid. >

[issue1308] unicode(None) anomaly

2007-10-21 Thread Martin v. Löwis
Martin v. Löwis added the comment: Ok. This is not a bug, but by design. unicode(X)==unicode(str(X)) for most things, and str(X)==repr(X) for most things. repr(None)=='None', hence the result you see. Closing as invalid. P.S. To respond via email, you have to add your email address to Your Detai

[issue1308] unicode(None) anomaly

2007-10-21 Thread James G. sack (jim)
James G. sack (jim) added the comment: Here's more: >>> unicode(object) u"" There seems to be an call to repr() somewhere in the process. This seems, at least to me, to violate the principle of least surprise, and I'm thinking that unicode(x) ought to return UnicodeDecodeError if x is not a

[issue1308] unicode(None) anomaly

2007-10-21 Thread James G. sack (jim)
James G. sack (jim) added the comment: (aside: Wow! that was a fast response to my posting!) I'm not really sure what makes the most sense, possibly: - an exception - u'' - None but not u'None'; not a string of length 4. That's quite unexpected! Regards, ..jim PS: I don't understand why I

[issue1308] unicode(None) anomaly

2007-10-21 Thread Martin v. Löwis
Martin v. Löwis added the comment: What answer did you expect instead? -- nosy: +loewis __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list m

[issue1308] unicode(None) anomaly

2007-10-21 Thread James G. sack (jim)
New submission from James G. sack (jim): '2.5 (r25:51908, Apr 10 2007, 10:27:40) \n[GCC 4.1.2 20070403 (Red Hat 4.1.2-8)]' unicode(None) u'None' This doesn't seem right, ;-) Regards, ,,jim -- components: Unicode messages: 56628 nosy: jgsack severity: normal status: open title: unicod