[Python-checkins] peps: Clarify that int(Enum) facilitates interoperability with C extensions that

eli.bendersky python-checkins at python.org
Mon Feb 25 15:17:13 CET 2013


http://hg.python.org/peps/rev/2a48d9b76487
changeset:   4773:2a48d9b76487
user:        Eli Bendersky <eliben at gmail.com>
date:        Mon Feb 25 06:16:51 2013 -0800
summary:
  Clarify that int(Enum) facilitates interoperability with C extensions that
expect integer values.

files:
  pepdraft-0435.txt |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/pepdraft-0435.txt b/pepdraft-0435.txt
--- a/pepdraft-0435.txt
+++ b/pepdraft-0435.txt
@@ -237,7 +237,8 @@
 
 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

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list