-
Notifications
You must be signed in to change notification settings - Fork 0
namedtuple and NamedTuple replacement that takes mixins to prefix #20
Comments
Piggyback off the existing implementation by actually constructing the namedtuple, but with an empty ns, then subtype it with the actual bases, substituting the namedtuple (require NamedTuple to be at the end of the bases), but forward the I suddenly remember why I don't usually do this exact kind of thing. |
From inspecting Dennis's use of the Current idea is to investigate making a class decorator that generates a new class. Basically, aim to re-implement namedtuples, but using ADT design principles. May end up renaming the |
Wait, this is just frozen dataclasses, isn't it. |
... But, I can hook into the existing destructurers instead of trying to teach it dataclasses. Current plan is to try making a base class that pulls in the necessary dependencies and does stuff in a |
Possibly, sum types should be made to work by the same mechanism. |
Untested, but this stuff is in the current master. |
Or maybe, some kind of helper metaclass that could be applied to mixins intended to go ahead of NamedTuples/namedtuples.
Motivation:
The text was updated successfully, but these errors were encountered: