Python has ticks, backticks and forward ticks
I am reading Thinking in Python, by Bruce Eckel, which I find fascinating.
However, I came across the folowing line: Code:
return ´self´ + self.val Code:
File "SingletonPattern.py", line 11 Code:
Traceback (most recent call last): Finally I dug up the solution in the code folder that comes with the html book and found the following: Code:
return `self` + self.val When I google ticks in python, the search comes up with timer ticks. Can someone explain ticks to me or point me to a good doc? |
Quote:
I find back ticks only in the grammar for 2.x, not 3.x: 5.2.9. String conversions |
Backticks are equivalent to repr() function. They should be avoided, as they're less readable and no longer available in Python 3.
|
quite a few scripting languages have backticks, ruby and perl for example.
|
All times are GMT -5. The time now is 12:20 AM. |