Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b70cca

Browse files
committed
Remove usage of backticks.
1 parent db60d6e commit 0b70cca

13 files changed

Lines changed: 14 additions & 16 deletions

Lib/idlelib/EditorWindow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ def newline_and_indent_event(self, event):
11381138
if not self.context_use_ps1:
11391139
for context in self.num_context_lines:
11401140
startat = max(lno - context, 1)
1141-
startatindex = `startat` + ".0"
1141+
startatindex = repr(startat) + ".0"
11421142
rawtext = text.get(startatindex, "insert")
11431143
y.set_str(rawtext)
11441144
bod = y.find_good_parse_start(

Lib/idlelib/HyperParser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def index2line(index):
3131
if not editwin.context_use_ps1:
3232
for context in editwin.num_context_lines:
3333
startat = max(lno - context, 1)
34-
startatindex = `startat` + ".0"
34+
startatindex = repr(startat) + ".0"
3535
stopatindex = "%d.end" % lno
3636
# We add the newline because PyParse requires a newline at end.
3737
# We add a space so that index won't be at end of line, so that

Lib/plat-mac/aetypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def __init__(self, keyword):
128128
self.keyword = "%-4.4s" % str(keyword)
129129

130130
def __repr__(self):
131-
return "Keyword(%r)" % `self.keyword`
131+
return "Keyword(%r)" % self.keyword
132132

133133
def __str__(self):
134134
return string.strip(self.keyword)

Lib/test/list_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_repr(self):
3737

3838
self.assertEqual(str(a0), str(l0))
3939
self.assertEqual(repr(a0), repr(l0))
40-
self.assertEqual(`a2`, `l2`)
40+
self.assertEqual(repr(a2), repr(l2))
4141
self.assertEqual(str(a2), "[0, 1, 2]")
4242
self.assertEqual(repr(a2), "[0, 1, 2]")
4343

Lib/test/test_doctest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ def test_DocTestParser(): r"""
605605
... if isinstance(piece, doctest.Example):
606606
... print 'Example:', (piece.source, piece.want, piece.lineno)
607607
... else:
608-
... print ' Text:', `piece`
608+
... print ' Text:', repr(piece)
609609
Text: '\n'
610610
Example: ('x, y = 2, 3 # no output expected\n', '', 1)
611611
Text: ''

Lib/test/test_grammar.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ def __getitem__(self, i):
685685

686686

687687
print 'atoms'
688-
### atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING
688+
### atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictmaker] '}' | NAME | NUMBER | STRING
689689
### dictmaker: test ':' test (',' test ':' test)* [',']
690690

691691
x = (1)
@@ -706,8 +706,6 @@ def __getitem__(self, i):
706706
x = {'one': 1, 'two': 2,}
707707
x = {'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6}
708708

709-
x = `x`
710-
x = `1 or 2 or 3`
711709
x = x
712710
x = 'x'
713711
x = 123

Lib/test/test_mutants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def __repr__(self):
209209
# Tim sez: "luck of the draw; crashes with or without for me."
210210
print >> f
211211

212-
return `"machiavelli"`
212+
return repr("machiavelli")
213213

214214
def __hash__(self):
215215
return 0

Lib/test/test_site.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def test_abs__file__(self):
164164
site.abs__file__()
165165
for module in (sys, os, __builtin__):
166166
try:
167-
self.failUnless(os.path.isabs(module.__file__), `module`)
167+
self.failUnless(os.path.isabs(module.__file__), repr(module))
168168
except AttributeError:
169169
continue
170170
# We could try everything in sys.modules; however, when regrtest.py

Lib/test/test_userdict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_all(self):
4646
# Test __repr__
4747
self.assertEqual(str(u0), str(d0))
4848
self.assertEqual(repr(u1), repr(d1))
49-
self.assertEqual(`u2`, `d2`)
49+
self.assertEqual(repr(u2), repr(d2))
5050

5151
# Test __cmp__ and __len__
5252
all = [d0, d1, d2, u, u0, u1, u2, uu, uu0, uu1, uu2]

Lib/test/test_weakref.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ def test_basic_ref(self):
5151
# Live reference:
5252
o = C()
5353
wr = weakref.ref(o)
54-
`wr`
54+
repr(wr)
5555
# Dead reference:
5656
del o
57-
`wr`
57+
repr(wr)
5858

5959
def test_basic_callback(self):
6060
self.check_basic_callback(C)

0 commit comments

Comments
 (0)