On Fri, Aug 14, 2020, 7:53 PM Caleb Donovick <[email protected]>
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.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/I3W5LWDAZAUIZ4JBCLK6I3JROWFFCJ7C/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to