[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

Scott Dial scott+python-dev at scottdial.com
Sat Apr 13 20:15:37 CEST 2013

On 4/12/2013 10:51 PM, Steven D'Aprano wrote:
> And two examples from asm-generic/errno.h:
> #define EWOULDBLOCK     EAGAIN  /* Operation would block */
> #define EDEADLOCK       EDEADLK

That's actually even better of an example than you may have realized
because historically EWOULDBLOCK != EAGAIN[1]. So, there very well may
need to exist such code as:

if <some hairy platform>:
    _EAGAIN = <X>

class Errno(Enum):

I don't think it's all that uncommon that enum values that represent
states of a system get merged or renamed over time, and this one is a
great example of that.


Scott Dial
scott at scottdial.com

More information about the Python-Dev mailing list