This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients ezio.melotti, gvanrossum, mrabarnett, pitrou, serhiy.storchaka
Date 2014-09-19.08:00:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411113614.13.0.291581810254.issue22434@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-09-19 08:00:14serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, pitrou, ezio.melotti, mrabarnett
2014-09-19 08:00:14serhiy.storchakasetmessageid: <1411113614.13.0.291581810254.issue22434@psf.upfronthosting.co.za>
2014-09-19 08:00:14serhiy.storchakalinkissue22434 messages
2014-09-19 08:00:13serhiy.storchakacreate