Replying to the list this time.

On 27 June 2018 at 15:46, Ethan Furman <et...@stoneleaf.us> 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

--
Ivan
_______________________________________________
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