When will regex really go away?
I ran Fredrik's listmodules script in my current sandbox and got a deprecation warning for the regex module. According to PEP 4 it is already obsolete. I saw nothing there about the timeframe for actual removal. Will it ever go away? Skip
On 1/24/06, skip@pobox.com
I ran Fredrik's listmodules script in my current sandbox and got a deprecation warning for the regex module. According to PEP 4 it is already obsolete. I saw nothing there about the timeframe for actual removal. Will it ever go away?
ASAP please! PEP 4 lists these that were already obsolete in 2.0: addpack, cmp, cmpcache, codehack, dircmp, dump, fmt, lockfile, newdir, Para, poly, regex, regsub, tb, timing, util, whatsound, tzmod, find, grep, packmail, ni, rand, soundex, cl, sv of these, regex, regsub, and timing are still importable in 2.4 (I don't have a 2.5 handy here at Google, and my home machine seems inaccessible). ISTM these last three can safely be dropped now. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
Guido> PEP 4 lists these that were already obsolete in 2.0: Guido> addpack, cmp, cmpcache, codehack, dircmp, dump, fmt, Guido> lockfile, newdir, Para, poly, regex, regsub, tb, timing, Guido> util, whatsound, tzmod, find, grep, packmail, ni, rand, Guido> soundex, cl, sv Guido> of these, regex, regsub, and timing are still importable in 2.4. And in 2.5. Regex and regsub both import with deprecation warnings. Timing imports without a peep. None of the others import. Skip
On 1/24/06, Guido van Rossum
On 1/24/06, skip@pobox.com
wrote: I ran Fredrik's listmodules script in my current sandbox and got a deprecation warning for the regex module. According to PEP 4 it is already obsolete. I saw nothing there about the timeframe for actual removal. Will it ever go away?
ASAP please!
PEP 4 lists these that were already obsolete in 2.0:
addpack, cmp, cmpcache, codehack, dircmp, dump, fmt, lockfile, newdir, Para, poly, regex, regsub, tb, timing, util, whatsound, tzmod, find, grep, packmail, ni, rand, soundex, cl, sv
of these, regex, regsub, and timing are still importable in 2.4 (I don't have a 2.5 handy here at Google, and my home machine seems inaccessible). ISTM these last three can safely be dropped now.
I'll do this, except there are some issues: * Lib/reconvert.py imports regex. Ok to move regex,regsub,recovert to lib-old? * ./Demo/pdist/rcslib.py & ./Demo/sockets/mcast.py import regsub. I don't know how to convert the uses of regsub to re, any volunteers? Shall I just add doc that they are broken? * A whole mess of Demos and Tools use regex. What to do about them? ./Demo/tkinter/guido/mbox.py:import regex ./Demo/tkinter/guido/ManPage.py:import regex ./Demo/tkinter/guido/tkman.py:import regex ./Demo/pdist/makechangelog.py:import regex ./Demo/scripts/mboxconvert.py:import regex ./Demo/scripts/ftpstats.py:import regex ./Demo/scripts/eqfix.py:import regex ./Demo/scripts/update.py:import regex ./Tools/scripts/pathfix.py:import regex ./Tools/scripts/fixcid.py:import regex ./Tools/scripts/classfix.py:import regex ./Tools/scripts/objgraph.py:import regex ./Tools/scripts/methfix.py:import regex ./Tools/scripts/pdeps.py:import regex ./Tools/scripts/ifdef.py:import regex
Neal> I'll do this, except there are some issues: Neal> * Lib/reconvert.py imports regex. Ok to move regex,regsub,recovert to lib-old? Neal> * ./Demo/pdist/rcslib.py & ./Demo/sockets/mcast.py import regsub.... ... Neal> * A whole mess of Demos and Tools use regex. What to do about them? ... How about creating Demo/old and populating it with stuff that imports regex, regsub or reconvert? Neal> I don't know how to convert the uses of regsub to re, any Neal> volunteers? Whippersnapper... sheesh! I still remember when all we had was regex. And we were thankful for it, by golly. Now you'd think the young-uns never knew it existed. <wink> As for converting from regex to re that's what reconvert is for. Give it a whirl. The docstring shows how to use it. Yet another Andrew Kuchling gem as I recall (or maybe an effbot gem). Either way, I was happy it was there when I needed it. Go in peace, reconvert. Skip
skip@pobox.com wrote:
The docstring shows how to use it. Yet another Andrew Kuchling gem as I recall (or maybe an effbot gem).
amk, most likely. and in 92.65% of all cases, switching from "regex" to "re" involves adding \ in front of (, | and ) if they don't already have them, and removing \ from any instances of (, | and ) that already have them. or something like that. </F>
skip@pobox.com wrote:
Neal> I'll do this, except there are some issues:
Neal> * Lib/reconvert.py imports regex. Ok to move regex,regsub,recovert to lib-old? Neal> * ./Demo/pdist/rcslib.py & ./Demo/sockets/mcast.py import regsub.... ... Neal> * A whole mess of Demos and Tools use regex. What to do about them? ...
How about creating Demo/old and populating it with stuff that imports regex, regsub or reconvert?
Neal> I don't know how to convert the uses of regsub to re, any Neal> volunteers?
Whippersnapper... sheesh! I still remember when all we had was regex. And we were thankful for it, by golly. Now you'd think the young-uns never knew it existed. <wink>
You had regex? You were lucky. (etc., etc.) yorkshireman-ly y'rs - steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd www.holdenweb.com Love me, love my blog holdenweb.blogspot.com
participants (5)
-
Fredrik Lundh
-
Guido van Rossum
-
Neal Norwitz
-
skip@pobox.com
-
Steve Holden