[issue33976] Enums don't support nested classes

2019-07-17 Thread Ethan Furman
Ethan Furman added the comment: Edward, I'm inclined to agree with you. It will take a couple versions for deprecation, etc., to push this through (assuming nobody comes up with a good counter-argument). In the mean-time, this change has landed in aenum [1] so you can use it now. [1] htt

[issue33976] Enums don't support nested classes

2018-06-27 Thread Edward Wang
Edward Wang added the comment: Ethan - thank you for your speedy response! For an example you can see https://github.com/ucb-bar/hammer/blob/97021bc7e1c819747f8b8b6d4b8c76cdc6a488e3/src/hammer-vlsi/hammer_vlsi_impl.py#L195 - the ObstructionType enum is really only used inside PlacementConstr

[issue33976] Enums don't support nested classes

2018-06-27 Thread Ethan Furman
Ethan Furman added the comment: Edward, thank you for taking the time to submit a patch, complete with tests! Do you have a real-world example of why Enum should work this way? -- assignee: -> ethan.furman nosy: +barry, eli.bendersky, ethan.furman ___

[issue33976] Enums don't support nested classes

2018-06-26 Thread Edward Wang
Change by Edward Wang : -- keywords: +patch pull_requests: +7557 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue33976] Enums don't support nested classes

2018-06-26 Thread Edward Wang
New submission from Edward Wang : Methods defined in Enums behave 'normally' but classes defined in Enums get mistaken for regular values and can't be used as classes out of the box. ```python class Outer(Enum): a = 1 b = 2 class Inner(Enum): foo = 10 bar = 11 ```