Closed frmdstryr closed 4 years ago
This would require special casing Atom members since currently a simple type check is performed.
It just needs to be a type. You can define your own type subclass with a magic method that hooks the type-checking validation (I forget the magic method name off the top of my head).
On Wed, Apr 8, 2020 at 9:29 AM Matthieu Dartiailh notifications@github.com wrote:
This would require special casing Atom members since currently a simple type check is performed.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nucleic/enaml/issues/408#issuecomment-610989119, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABBQSLAXXG5Y7O4NMPMQVDRLSCCZANCNFSM4MD63K4A .
__instancecheck__
works but it seems like a hack compared to passing in a member.
It'd be nice to be able to have more explicit control of the type of an attr using an atom member.
Ex
I assume it doesn't do this because parsing it becomes a mess?