On Wed, Jun 27, 2018, at 15:04, Elazar wrote:
> People working with sum types might expect the instances of the nested
> class to be instances of the enclosing class. So if the nested class is a
> namedtuple, you get a sum type. The only problem is that there's no way to
> express this subtype relationship in code.

I bet you could get around it with a custom __build_class__.

(As for preventing the nested class from being an enum member, @staticmethod 
works to get around that)
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to