[Python-Dev] py3k and not equal; re names

Smith smiles at worksmail.net
Thu Feb 9 09:41:17 CET 2006

I'm wondering if it's just "foolish consistency" (to quote a PEP 8) that is calling for the dropping of <> in preference of only !=. I've used the former since the beginning in everything from basic, fortran, claris works, excel, gnumeric, and python. I tried to find a rationale for the dropping--perhaps there is some other object that will be represented (like an empty set). I'm sure there must be some reason, but just want to put a vote in for keeping this variety.

And another suggestion for py3k would be to increase the correspondence between string methods and re methods. e.g. since re.match and string.startswith are checking for the same thing, was there a reason to introduce the new names? The same question is asked for string.find and re.search.

Instead of having to learn another set of method names to use re, it would be nice to have the only change be the pattern used for the method.  Here is a side-by-side listing of methods in both modules that are candidates for consistency--hopefully not "foolish" ;-)

      string        re
      ------        ------
      find          search  

startswith    match
split         split
replace       sub
NA            subn
NA            findall
NA            finditer


More information about the Python-Dev mailing list