[issue33976] Enums don't support nested classes

Edward Wang report at bugs.python.org
Wed Jun 27 03:15:40 EDT 2018


Edward Wang <edward.c.wang at compdigitec.com> 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 PlacementConstraintType, so it was thought to be logical to nest ObstructionType inside PlacementConstraintType and reference it as PlacementConstraintType.ObstructionType.

It just seemed weird that inline class definitions inside an Enum get treated as an enum value while functions defined inside Enums are treated as methods - as a user it would make more sense to have them both treated the same way (not as enum values), I think.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33976>
_______________________________________


More information about the Python-bugs-list mailing list