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]
|
location: tuple[int, int]
|
||||||
|
|
||||||
def with_location(self, location: tuple[int, int]) -> "Token":
|
def with_location(self, location: tuple[int, int]) -> "Token":
|
||||||
return Token(
|
return Token(**self, location=location)
|
||||||
name=self.name,
|
|
||||||
value=self.value,
|
|
||||||
path=self.path,
|
|
||||||
code=self.code,
|
|
||||||
location=location,
|
|
||||||
)
|
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return self.value
|
return self.value
|
||||||
|
|||||||
Reference in New Issue
Block a user