New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unicode(None) anomaly #45649
Comments
'2.5 (r25:51908, Apr 10 2007, 10:27:40) \n[GCC 4.1.2 20070403 (Red Hat unicode(None)
u'None' This doesn't seem right, ;-) Regards, |
What answer did you expect instead? |
(aside: Wow! that was a fast response to my posting!) I'm not really sure what makes the most sense,
but not u'None'; not a string of length 4. That's quite unexpected! Regards, PS: I don't understand why I couldn't reply via email. I got an autoresponse You are not a registered user. Please register at: http://bugs.python.org/user?@template=register ...before sending mail to the tracker. Unknown address: jgsack... I tried the registration, but that failed. I thought I _was_ registered. Oh, well. :-[ |
Here's more: >>> unicode(object)
u"<type 'object'>" 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 Maybe this is argueable. If so, I'd like to be educated. :-) Regards, |
Ok. This is not a bug, but by design. unicode(X)==unicode(str(X)) for P.S. To respond via email, you have to add your email address to Your |
Martin v. Löwis wrote:
OK, thanks Martin. Now that I think about it, I do understand. My difficulty (and source of my surprise) was in mistakenly thinking of I would now say that it is better thought of as a representation With that mindset, there is no surprise. Thanks again, for your prompt attention and useful replies. Regards, |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: