My own personal use for this would be for generating anonymous protocols and dataclasses:
class T(Protocol): x: int y: str # with some abuse of notation obviously these would generate unique types assert T == Struct[x=int, y=str] # similarly @dataclass class S: x: int y: str assert S == Struct[x=int, y=str]
I often want to create such types “on the fly” without needing to put a name on them.
Now as I don’t need mixed keyword / positional arguments I can achieve this with:
# K = dict Struct[K(x=int, y=str)]
But that costs 3 more keystrokes and is certainly less beautiful.
While I would not personally use this I think a real killer app would be slicing named axis, as the slice syntax is exclusive to geitem and hence can not leverage the dict trick.