module documentation

Undocumented

Function infer_pattern_match Infer regex.Pattern and regex.Match as classes.
Constant CLASS_GETITEM_TEMPLATE Undocumented
Function _looks_like_pattern_or_match Check for regex.Pattern or regex.Match call in stdlib.
Function _regex_transform The RegexFlag enum exposes all its entries by updating globals().
def infer_pattern_match(node: nodes.Call, ctx: context.InferenceContext|None = None): (source)

Infer regex.Pattern and regex.Match as classes. For PY39+ add `__class_getitem__`.

CLASS_GETITEM_TEMPLATE: str = (source)

Undocumented

Value
'''
@classmethod
def __class_getitem__(cls, item):
    return cls
'''
def _looks_like_pattern_or_match(node: nodes.Call) -> bool: (source)

Check for regex.Pattern or regex.Match call in stdlib. Match these patterns from stdlib/re.py ```py Pattern = type(...) Match = type(...) ```

def _regex_transform() -> nodes.Module: (source)

The RegexFlag enum exposes all its entries by updating globals(). We hard-code the flags for now. # pylint: disable-next=line-too-long See https://github.com/mrabarnett/mrab-regex/blob/2022.10.31/regex_3/regex.py#L200