Message227083
Here is a patch using enums. I still think enums are superfluous here. Advanced the Enum class features (pickling, access by name, type checking) are not needed - these constants don't leaked in outer word.
> I don't see where there would be a circular dependency; the enum module
> doesn't import the re module.
Right now there is no circular dependency. But the enum module imports collections which imports a lot of other modules, some of which import other modules. In future some of indirectly imported module can import the re module.
> There is one thing that might be less convenient: defining an enum doesn't
> automatically make the values globals. But wouldn't the code be better if
> the values weren't globals?
I afraid this will make the code of parser and compiler less readable and slower. In any case the sre_constants module itself is a namespace. |
|
Date |
User |
Action |
Args |
2014-09-19 08:00:14 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, pitrou, ezio.melotti, mrabarnett |
2014-09-19 08:00:14 | serhiy.storchaka | set | messageid: <1411113614.13.0.291581810254.issue22434@psf.upfronthosting.co.za> |
2014-09-19 08:00:14 | serhiy.storchaka | link | issue22434 messages |
2014-09-19 08:00:13 | serhiy.storchaka | create | |
|