Why use backticks?

Greg Ewing (using news.cis.dfn.de) ckea25d02 at sneakemail.com
Thu May 8 20:47:25 EDT 2003


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

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg





More information about the Python-list mailing list