Alex Waygood <alex.wayg...@gmail.com> added the comment:

I had a go at writing a patch for `__dir__` that would include any methods an 
enum class had acquired through `int`/`str`/etc. mixins, while continuing to 
ignore enum dunders and sunders (as is currently the case). My patch also 
allows user-defined methods defined in enum subclasses to show up in the 
`help()` output, whereas they currently do not, since `help(enum_member)` looks 
up `dir(enum_class)` rather than `dir(enum_member)`.

The patch is a fair way more complex than the the existing code, however.

----------
nosy: +AlexWaygood
Added file: https://bugs.python.org/file50382/Enum_dir_patch.txt

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45535>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to