module documentation

Basic checker for Python code.

Class TypeVarVariance Undocumented
Constant BUILTIN_PROPERTY Undocumented
Constant DEFAULT_PATTERNS Undocumented
Constant EXEMPT_NAME_CATEGORIES Undocumented
Constant TYPE_VAR_QNAME Undocumented
Function _determine_function_name_type Determine the name type whose regex the function's name should match.
Function _get_properties Returns a tuple of property classes and names.
Function _is_multi_naming_match Undocumented
Function _redefines_import Detect that the given node (AssignName) is inside an exception handler and redefines an import from the tryexcept body.
Type Alias _BadNamesTuple Undocumented
BUILTIN_PROPERTY: str = (source)

Undocumented

Value
'builtins.property'
DEFAULT_PATTERNS = (source)

Undocumented

Value
{'typevar': re.compile(r'^_{,2}(?!T[A-Z])(?:[A-Z]+|(?:[A-Z]+[a-z]+)+T?(?<!Type))
(?:_co(?:ntra)?)?$'),
 'typealias': re.compile(r'^_{,2}(?!T[A-Z]|ype)[A-Z]+[a-z]+(?:[A-Z][a-z]+)*$')}
EXEMPT_NAME_CATEGORIES: set[str] = (source)

Undocumented

Value
set(['exempt', 'ignore'])
TYPE_VAR_QNAME = (source)

Undocumented

Value
frozenset(('typing.TypeVar', 'typing_extensions.TypeVar'))
def _determine_function_name_type(node: nodes.FunctionDef, config: argparse.Namespace) -> str: (source)

Determine the name type whose regex the function's name should match. :param node: A function node. :param config: Configuration from which to pull additional property classes. :returns: One of ('function', 'method', 'attr')

def _get_properties(config: argparse.Namespace) -> tuple[set[str], set[str]]: (source)

Returns a tuple of property classes and names. Property classes are fully qualified, such as 'abc.abstractproperty' and property names are the actual names, such as 'abstract_property'.

def _is_multi_naming_match(match: re.Match[str]|None, node_type: str, confidence: interfaces.Confidence) -> bool: (source)

Undocumented

def _redefines_import(node: nodes.AssignName) -> bool: (source)

Detect that the given node (AssignName) is inside an exception handler and redefines an import from the tryexcept body. Returns True if the node redefines an import, False otherwise.

_BadNamesTuple = (source)