~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lazy_regex.py

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Lazily compiled regex objects.
18
18
 
19
 
This module defines a class which creates proxy objects for regex
20
 
compilation.  This allows overriding re.compile() to return lazily compiled
21
 
objects.  
22
 
 
23
 
We do this rather than just providing a new interface so that it will also
24
 
be used by existing Python modules that create regexs.
 
19
This module defines a class which creates proxy objects for regex compilation.
 
20
This allows overriding re.compile() to return lazily compiled objects.
25
21
"""
26
22
 
27
23
import re
48
44
    def __init__(self, args=(), kwargs={}):
49
45
        """Create a new proxy object, passing in the args to pass to re.compile
50
46
 
51
 
        :param args: The `*args` to pass to re.compile
52
 
        :param kwargs: The `**kwargs` to pass to re.compile
 
47
        :param args: The *args to pass to re.compile
 
48
        :param kwargs: The **kwargs to pass to re.compile
53
49
        """
54
50
        self._real_regex = None
55
51
        self._regex_args = args