[issue22434] Use named constants internally in the re module
Serhiy Storchaka
report at bugs.python.org
Thu Sep 18 18:14:49 CEST 2014
Serhiy Storchaka added the comment:
Answering Guido's question about the Enum class. No, it is not appropriate here. It has too cumbersome repr (<OPCODES.IN_IGNORE: 16> instead of IN_IGNORE). Enum function syntax can't by used because it enumerates values from 1. We need three Enum subclasses for three groups of constants, and fourth class for MAXREPEAT, and fifth base abstract class. To fit the Enum class to our need we need more boilerplate code than to implement minimal needed functionality from scratch. And I'm not sure that this will not create circular dependency.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22434>
_______________________________________
More information about the Python-bugs-list
mailing list