Clarify that int(Enum) facilitates interoperability with C extensions that
expect integer values.
This commit is contained in:
parent
373b80f240
commit
e24ea517b3
|
@ -237,7 +237,8 @@ values will always compare not equal::
|
|||
|
||||
If you really want the integer equivalent values, you can convert enumeration
|
||||
values explicitly using the ``int()`` built-in. This is quite convenient for
|
||||
storing enums in a database for example::
|
||||
storing enums in a database, as well as for interoperability with C extensions
|
||||
that expect integers::
|
||||
|
||||
>>> int(Colors.red)
|
||||
1
|
||||
|
|
Loading…
Reference in New Issue