Skip to content

Commit 27f8152

Browse files
changelingCito
authored andcommitted
Refactor residual .format()s to f-strings. (#32)
Replace .format() with f-string in ast.py and lexer.py.
1 parent b0fa058 commit 27f8152

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

graphql/language/ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __str__(self):
8383

8484
def __repr__(self):
8585
"""Print a simplified form when appearing in repr() or inspect()."""
86-
return "<Location {}:{}>".format(self.start, self.end)
86+
return f"<Location {self.start}:{self.end}>"
8787

8888
def __inspect__(self):
8989
return repr(self)

graphql/language/lexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __str__(self):
6161

6262
def __repr__(self):
6363
"""Print a simplified form when appearing in repr() or inspect()."""
64-
return "<Token {} {}/{}>".format(self.desc, self.line, self.column)
64+
return f"<Token {self.desc} {self.line}/{self.column}>"
6565

6666
def __inspect__(self):
6767
return repr(self)

0 commit comments

Comments
 (0)