LinkedRoute
bswck opened this issue · comments
Bartosz Sławecki commented
Use case
A config route that supports type-safety and runtime validation.
If we have
class ConfItem(BaseConfiguration):
pair: tuple[int, int]
class Conf(BaseConfiguration):
item: ConfItem
then instead of writing
Conf.at("item.pair[0]")
write
Conf.at(Conf.item.pair[0])
where
Conf.item.pair[0]
is in fact
LinkedRoute(Conf, Route([GetAttr("item"), GetAttr("pair"), GetItem(0)]))
at runtime.
Example usage
No response
Additional context
No response