class TypingChecker(BaseChecker): (source)
Find issue specifically related to type annotations.
Method | __init__ |
Initialize checker instance. |
Method | leave |
After parsing of module is complete, add messages for 'consider-using-alias' check. |
Method | open |
Called before visiting project (i.e. set of modules). |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Class Variable | msgs |
Undocumented |
Class Variable | name |
Name of the provider. |
Class Variable | options |
Options provided by this provider. |
Static Method | _is |
Undocumented |
Static Method | _is |
Undocumented |
Method | _broken |
Check if node would be a broken location for collections.abc.Callable. |
Method | _check |
Check for 'collections.abc.Callable' inside Optional and Union. |
Method | _check |
Check for 'NoReturn' inside compound types. |
Method | _check |
Check if alternative union syntax could be used. |
Method | _check |
Check if typing alias is deprecated or could be replaced. |
Method | _check |
Undocumented |
Method | _is |
Undocumented |
Method | _msg |
Message hint if postponed evaluation isn't enabled. |
Method | _parse |
Undocumented |
Instance Variable | _alias |
Undocumented |
Instance Variable | _consider |
Undocumented |
Instance Variable | _deprecated |
Undocumented |
Instance Variable | _found |
Undocumented |
Instance Variable | _py310 |
Undocumented |
Instance Variable | _py37 |
Undocumented |
Instance Variable | _py39 |
Undocumented |
Instance Variable | _should |
The use of alternative union syntax (PEP 604) requires Python 3.10 or Python 3.7+ with postponed evaluation. |
Instance Variable | _should |
Undocumented |
Instance Variable | _should |
Undocumented |
Instance Variable | _should |
The use of type aliases (PEP 585) requires Python 3.9 or Python 3.7+ with postponed evaluation. |
Inherited from BaseChecker
:
Method | __eq__ |
Permit to assert Checkers are equal. |
Method | __gt__ |
Sorting of checkers. |
Method | __hash__ |
Make Checker hashable. |
Method | __repr__ |
Undocumented |
Method | __str__ |
This might be incomplete because multiple classes inheriting BaseChecker can have the same name. |
Method | add |
Undocumented |
Method | check |
Check the consistency of msgid. |
Method | close |
Called after visiting project (i.e set of modules). |
Method | create |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | reduce |
Undocumented |
Class Variable | enabled |
Undocumented |
Class Variable | reports |
Undocumented |
Instance Variable | linter |
Undocumented |
Property | messages |
Undocumented |
Inherited from _ArgumentsProvider
(via BaseChecker
):
Method | get |
DEPRECATED: Return the dictionary defining an option given its name. |
Method | level |
Undocumented |
Method | load |
DEPRECATED: Initialize the provider using default values. |
Method | option |
DEPRECATED: Get the config attribute corresponding to opt. |
Method | option |
DEPRECATED: Get the current value for the given option. |
Method | options |
DEPRECATED. |
Method | options |
DEPRECATED: Return an iterator on options grouped by section. |
Method | set |
DEPRECATED: Method called to set an option (registered in the options list). |
Class Variable | option |
Option groups of this provider and their descriptions. |
Property | config |
Undocumented |
Property | level |
Undocumented |
Instance Variable | _arguments |
The manager that will parse and register any options provided. |
Instance Variable | _level |
Undocumented |
def leave_module(self, node:
nodes.Module
):
(source)
¶
After parsing of module is complete, add messages for 'consider-using-alias' check. Make sure results are safe to recommend / collision free.
def visit_annassign(self, node:
nodes.AnnAssign
):
(source)
¶
Undocumented
def visit_attribute(self, node:
nodes.Attribute
):
(source)
¶
Undocumented
def visit_name(self, node:
nodes.Name
):
(source)
¶
Undocumented
def _is_deprecated_union_annotation(annotation:
nodes.NodeNG
, union_name: str
) -> bool
:
(source)
¶
Undocumented
nodes.Name|nodes.Attribute
, name: str
):
(source)
¶
Check if alternative union syntax could be used. Requires - Python 3.10 - OR: Python 3.7+ with postponed evaluation in a type annotation context
Check if typing alias is deprecated or could be replaced. Requires - Python 3.9 - OR: Python 3.7+ with postponed evaluation in a type annotation context For Python 3.7+: Only emit message if change doesn't create any name collisions, only ever used in a type annotation context, and can safely be replaced.
nodes.BinOp
, typehints_list: list[ nodes.NodeNG]|None
= None) -> list[ nodes.NodeNG]
:
(source)
¶
Undocumented