Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > what u'=' mean???

Reply
Thread Tools

what u'=' mean???

 
 
Luiz Siqueira Neto
Guest
Posts: n/a
 
      07-17-2003
What
----
u'='
----
mean??

Ex:

args = [u'='.join(k,safe_eval(v) for k, v in attrs.items()]

 
Reply With Quote
 
 
 
 
Ricardo Bugalho
Guest
Posts: n/a
 
      07-17-2003
On Thu, 17 Jul 2003 12:24:57 -0300, Luiz Siqueira Neto wrote:

> What
> ----
> u'='


Its just a unicode string.
The string constants in Python can be prefixed with a u. Instead of
building a string object for that constant, the interpreter will build a
Unicode string object.

You can also prefix them with r, to make the interpreter ignore escape
codes.
For example:
>>> print 'a\nb'

a
b
>>> print 'a\\nb'

a\nb
>>> print r'a\nb'

a\nb
>>>


And you can use the combined ur prefix.


--
Ricardo

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments