Bin Chen
Bin Chen

Reputation: 63299

python: what does u'{' represent?

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

Upvotes: 2

Views: 350

Answers (3)

bwooceli
bwooceli

Reputation: 371

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.

Upvotes: 2

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262919

It meant UNICODE string literal before Python 3.

Documentation about all these literal adornments can be found there.

Upvotes: 7

苏妍倩
苏妍倩

Reputation: 331

Unicode Constructors talks about unicode.

Upvotes: 2

Related Questions