module documentation

Undocumented

Class ASTConverter No class docstring; 0/7 instance variable, 0/2 constant, 6/98 methods documented
Class TypeConverter No class docstring; 0/5 instance variable, 4/27 methods documented
Function ast3_parse Undocumented
Function is_no_type_check_decorator Undocumented
Function parse Parse a source file, without doing any semantic analysis.
Function parse_type_comment Parse type portion of a type comment (+ optional type ignore).
Function parse_type_ignore_tag Parse optional "[code, ...]" tag after "# type: ignore".
Function parse_type_string Parses a type that was originally present inside of an explicit string.
Function stringify_name Undocumented
Constant INVALID_TYPE_IGNORE Undocumented
Constant MISSING_FALLBACK Undocumented
Constant PY_MINOR_VERSION Undocumented
Constant TYPE_COMMENT_SYNTAX_ERROR Undocumented
Constant TYPE_IGNORE_PATTERN Undocumented
Type Variable N Undocumented
Type Alias AstNode Undocumented
Constant _dummy_fallback Undocumented
def ast3_parse(source: str|bytes, filename: str, mode: str, feature_version: int = PY_MINOR_VERSION) -> AST: (source)

Undocumented

def is_no_type_check_decorator(expr: ast3.expr) -> bool: (source)

Undocumented

def parse(source: str|bytes, fnam: str, module: str|None, errors: Errors|None = None, options: Options|None = None) -> MypyFile: (source)

Parse a source file, without doing any semantic analysis. Return the parse tree. If errors is not provided, raise ParseError on failure. Otherwise, use the errors object to report parse errors.

def parse_type_comment(type_comment: str, line: int, column: int, errors: Errors|None) -> tuple[list[str]|None, ProperType|None]: (source)

Parse type portion of a type comment (+ optional type ignore). Return (ignore info, parsed type).

def parse_type_ignore_tag(tag: str|None) -> list[str]|None: (source)

Parse optional "[code, ...]" tag after "# type: ignore". Return: * [] if no tag was found (ignore all errors) * list of ignored error codes if a tag was found * None if the tag was invalid.

def parse_type_string(expr_string: str, expr_fallback_name: str, line: int, column: int) -> ProperType: (source)

Parses a type that was originally present inside of an explicit string. For example, suppose we have the type `Foo["blah"]`. We should parse the string expression "blah" using this function.

def stringify_name(n: AST) -> str|None: (source)

Undocumented

INVALID_TYPE_IGNORE: str = (source)

Undocumented

Value
'Invalid "type: ignore" comment'
MISSING_FALLBACK = (source)

Undocumented

Value
FakeInfo('fallback can\'t be filled out until semanal')
PY_MINOR_VERSION = (source)

Undocumented

Value
sys.version_info[1]
TYPE_COMMENT_SYNTAX_ERROR: str = (source)

Undocumented

Value
'syntax error in type comment'
TYPE_IGNORE_PATTERN = (source)

Undocumented

Value
re.compile(r'[^#]*#\s*type:\s*ignore\s*(.*)')

Undocumented

Value
TypeVar('N',
        bound=Node)

Undocumented

Value
Union[ast3.expr, ast3.stmt, ast3.pattern, ast3.ExceptHandler]
_dummy_fallback = (source)

Undocumented

Value
Instance(MISSING_FALLBACK, [], -1)