mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Tidy up Token.with_location
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user