[Python-Dev] SRE: what to do with undocumented attributes?

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Fri, 31 Mar 2000 00:40:51 +0200

at this time, SRE uses types instead of classes for compiled
patterns and matches.  these classes provide a documented
interface, and a bunch of internal attributes, for example:


    code -- a PCRE code object
    pattern -- the source pattern
    groupindex -- maps group names to group indices


    regs -- same as match.span()?
    groupindex -- as above
    re -- the pattern object used for this match
    string -- the target string used for this match

the problem is that some other modules use these attributes
directly.  for example, xmllib.py uses the pattern attribute, and
other code I've seen uses regs to speed things up.

in SRE, I would like to get rid of all these (except possibly for
the match.string attribute).