On 07/01/2018 06:03 AM, Ivan Levkivskyi wrote:> On 27 June 2018 at 15:46, Ethan 
Furman wrote:

[...]
So I'm asking the community:  What real-world examples can you offer for either 
behavior?  Cases where nested
classes should be enum members, and cases where nested classes should not be 
members.

I wanted few times to make an enum of enums. For example:

class  Method(Enum):
     Powell = 1
     Newton_CG = 2
     <few more>
     class Trust(Enum):
         Constr = 3
         Exact = 4
         <few more>

So that one can write:

minimize(..., method=Method.Powell)
minimize(..., method=Method.Trust.Exact)  # this currently fails

In such a case, would you want/expect for

--> list(Method)

to return

[<Powel: 1>, <Newton_CG: 2>, ..., <Trust: -something->]

?

--
~Ethan~

_______________________________________________
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