Re: Enum with nested classes or with types as members

2018-09-12 Thread Ben Finney
Ethan Furman writes: > I'm asking because in doing some work on Enum it became apparent to me > that having nested classes was not a smooth, satisfying experience, > and I'm considering treating them the same way as methods (they will > no longer be converted into members). For reference (and

Enum with nested classes or with types as members

2018-09-11 Thread Ethan Furman
Greetings! So the stdlib Enum has been around for a few years now. Has anyone written an enum that either had types as members: class Types(Enum): Int = int Str = str or that had nested classes: class Types(Enum): class Contained(Enum): circle = 1