开发者

python: what does u'{' represent?

开发者 https://www.devze.com 2023-01-24 17:38 出处:网络
When I print out a value it has a u开发者_Go百科 in front of it, I think it is some type notation, what is it? Where I can find a list of such notations?It meant UNICODE string literal before Python 3

When I print out a value it has a u开发者_Go百科 in front of it, I think it is some type notation, what is it? Where I can find a list of such notations?


It meant UNICODE string literal before Python 3.

Documentation about all these literal adornments can be found there.


Unicode Constructors talks about unicode.


That's creating a unicode string. I'd recommend this section from Dive into Python on the topic

There are many advantages to explicitly using unicode, the most common reason for doing so is to force integrity when working with a database.

0

精彩评论

暂无评论...
验证码 换一张
取 消