Why use backticks?
Gary D. Duzan
gduzan at bbn.com
Mon May 12 13:22:30 EDT 2003
In article <b9esta$i83f5$1 at ID-169208.news.dfncis.de>,
Greg Ewing (using news.cis.dfn.de) <ckea25d02 at sneakemail.com> wrote:
>Francis Avila wrote:
>> In my experience they are used mostly in pasting together strings, where
>> they remove a lot of verbosity and look somewhat more natural. Compare:
>>
>> 'x = '+`x`.
>> 'x = ' + repr(x)
>
>I would write that as
>
> 'x = %r' % x
Unless x can hold a tuple, in which case you want:
'x = %r' % (x,)
Gary Duzan
BBN Technologies
A Verizon Company
More information about the Python-list
mailing list