[issue19624] Switch constants in the errno module to IntEnum
Changes by Ethan Furman et...@stoneleaf.us: -- resolution: - rejected stage: needs patch - status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
Antoine Pitrou added the comment: An option is to rename the C errno module to _errno and leave it unchanged, and provide a Python errno module which enum API. I agree it sounds reasonable. Using enum for errno should not slow down Python startup time. enum imports OrderedDict from collections, which imports other modules... -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
Antoine Pitrou added the comment: Note that even if errno is migrated to enum, OSErrors raised by the interpreter will still have a raw int errno... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
Marc-Andre Lemburg added the comment: I'm not sure whether changing the errno module to use enums would be conceptually correct: enums declare a fixed set of permitted values, but errno values can be any integer, are platform dependent and are sometimes not unique (e.g. EWOULDBLOCK = EAGAIN, or the various Windows WSA errno values which map to similar integers as the Unix ones). -- nosy: +lemburg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
STINNER Victor added the comment: I don't know if it's possible/convinient, but it would be nice to have a str() method using os.strerror(). Or maybe a method with a different name. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
STINNER Victor added the comment: This is not so easy issue because the errno module is not pure Python module. ;) An option is to rename the C errno module to _errno and leave it unchanged, and provide a Python errno module which enum API. Then slowly errno module should be used instead of _errno. Using enum for errno should not slow down Python startup time. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
Changes by Eli Bendersky eli...@gmail.com: -- keywords: -easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
Chris added the comment: I would be interested in tackling this as a first patch, can you give me some more information? -- nosy: +chrishood ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
Ethan Furman added the comment: Check out socket.py for an example of constants being changed over to IntEnum. Feel free to ask more questions! :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
Ethan Furman added the comment: Also see Issue18720 for those details. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
Serhiy Storchaka added the comment: This is not so easy issue because the errno module is not pure Python module. ;) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
Chris added the comment: I think I'll look for some other issues, this one looks a bit deep for a first patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
Changes by Ezio Melotti ezio.melo...@gmail.com: -- keywords: +easy type: - enhancement versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19624] Switch constants in the errno module to IntEnum
New submission from Serhiy Storchaka: It will be good to switch constants in the errno module to IntEnum. -- components: Extension Modules, Library (Lib) messages: 203035 nosy: barry, eli.bendersky, ethan.furman, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Switch constants in the errno module to IntEnum versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19624 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com