[Python-Dev] Should we move to replace re with regex?

Antoine Pitrou solipsis at pitrou.net
Sat Aug 27 03:59:16 CEST 2011


On Fri, 26 Aug 2011 17:25:56 -0700
Dan Stromberg <drsalists at gmail.com> wrote:
> On Fri, Aug 26, 2011 at 5:08 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> 
> > On Fri, 26 Aug 2011 15:48:42 -0700
> > Dan Stromberg <drsalists at gmail.com> wrote:
> > >
> > > Then there probably should be a from __future__ import for a while.
> >
> > If you are willing to use a "from __future__ import", why not simply
> >
> >    import regex as re
> >
> > ? We're not Perl, we don't have built-in syntactic support for regular
> > expressions.
> >
> > Regards
> >
> 
> If you add regex as "import regex", and the new regex module doesn't work
> out, regex might be harder to get rid of.  from __future__ import is an
> established way of trying something for a while to see if it's going to
> work.

That's an interesting idea. This way, integrating the new module would
be a less risky move, since if it gives us too many problems, we could
back out our decision in the next feature release.

Regards

Antoine.


More information about the Python-Dev mailing list