Aug. 14, 2020
5:27 p.m.
On Fri, Aug 14, 2020, 7:53 PM Caleb Donovick <donovick@cs.stanford.edu> wrote:
I don't see what that can possible get you that `Struct(x=int, y=str)` doesn't.
Using `Struct(x=int, y=str)` requires a metaclass, where `Struct[x=int, y=str]` does not.
Why would it require a metaclass? Rather than just: class Struct: def __init__(self, **kws): ... Yes, that won't get you the MRO for T, but neither can __getitem__() on an entirely different object Struct. A class factory is also an option, of course.