b.l.LazyRegex(object) : class documentation

Part of bzrlib.lazy_regex View In Hierarchy

Known subclasses: bzrlib.tests.test_lazy_regex.InstrumentedLazyRegex

A proxy around a real regex, which won't be compiled until accessed.
Method __init__ Create a new proxy object, passing in the args to pass to re.compile
Method __getattr__ Return a member from the proxied regex object.
Method _compile_and_collapse Actually compile the requested regex
Method _real_re_compile Thunk over to the original re.compile
def __init__(self, args=(), kwargs={}):
Create a new proxy object, passing in the args to pass to re.compile
ParametersargsThe *args to pass to re.compile
kwargsThe **kwargs to pass to re.compile
def _compile_and_collapse(self):
Actually compile the requested regex
def _real_re_compile(self, *args, **kwargs):
Thunk over to the original re.compile
def __getattr__(self, attr):
Return a member from the proxied regex object.

If the regex hasn't been compiled yet, compile it

API Documentation for Bazaar, generated by pydoctor at 2019-07-21 00:34:56.