module documentation

Undocumented

Function infer_pattern_match Infer re.Pattern and re.Match as classes. For PY39+ add __class_getitem__.
Constant CLASS_GETITEM_TEMPLATE Undocumented
Function _looks_like_pattern_or_match Check for re.Pattern or re.Match call in stdlib.
Function _re_transform Undocumented
def infer_pattern_match(node: nodes.Call, ctx: context.InferenceContext | None = None): (source)

Infer re.Pattern and re.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 re.Pattern or re.Match call in stdlib.

Match these patterns from stdlib/re.py `py Pattern = type(...) Match = type(...) `

def _re_transform(): (source)

Undocumented