Replace LazyTuple with a more specialized object
- Dominant language
- Python
- Stars
- 5
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Information about the location and roff-type is coerced during parsing, and returned either as a tuple or the lazy-tuple (where values are fetched from file in `__getitem__`). It would be more usefult to return the same Tuple object which retains information such as location:
```
@dataclass
class TagKey:
value_token: Token
stream: io.BufferedReader
value: Any = None
def load(self):
if value is None:
value = value_token.get_value(self.stream)
def __getitem__(self):
self.load()
...
```
This way additional information about the tagkey can be retained and its easier to control error messages.
This is unfortunately a breaking change, so not planned at this point.
Contributor guide
Assessment
This issue has not been assessed yet.