pyelftools
pyelftools copied to clipboard
Access enums as enums, not strings?
It would be nice if enums such as E_MACHINE were exposed as Python enum.Enum instead of strings?
>>> elf = elftools.elf.elffile.ELFFile(open("/usr/bin/find", "rb"))
>>> elf.header.e_machine
'EM_X86_64'
>>> type(elf.header.e_machine)
<class 'str'>
https://docs.python.org/3/library/enum.html
Yes, this means Python 3.4 onwards only. Considering at the time of writing Python 2 is EOL in 20 days, is this still an issue?
I'd prefer not to do breaking changes at this point. If this can be packaged as a non-breaking change, I will consider accepting a PR when Python 2 officially EOLs.