Tidy up Token.with_location

This commit is contained in:
Darren Burns
2022-02-03 13:17:59 +00:00
parent 9dfc1ddabb
commit c18b1b9fed

View File

@@ -47,13 +47,7 @@ class Token(NamedTuple):
location: tuple[int, int]
def with_location(self, location: tuple[int, int]) -> "Token":
return Token(
name=self.name,
value=self.value,
path=self.path,
code=self.code,
location=location,
)
return Token(**self, location=location)
def __str__(self) -> str:
return self.value