Backticks: What up?

Steven Brent stevenbee at removethis.att.net
Tue Apr 27 19:39:32 EDT 2004


I was wondering why the backticks in the following fragment:

        return 'Here's the result: ' + `self.data`

My guess is that in a return statement (as opposed to a print statement)
it's necessary to do this in order to get the self.data instance attribute
as a string, so it can be concatenated with the 'Here's the result: '
string.

What exactly do the backticks do, then? Just return the result of an
expression as a string? Does my guess make sense and / or is it correct?
Elucidations and gentle ridicule welcome.

TIA.



More information about the Python-list mailing list