Undocumented
Class | ASTConverter |
No class docstring; 0/7 instance variable, 0/2 constant, 2/84 methods documented |
Class | TypeConverter |
No class docstring; 0/6 instance variable, 4/28 methods documented |
Function | ast3_parse |
Undocumented |
Function | bytes_to_human_readable_repr |
Converts bytes into some human-readable representation. Unprintable bytes such as the nul byte are escaped. For example: |
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, byte string, or unicode string. |
Function | stringify_name |
Undocumented |
Constant | INVALID_TYPE_IGNORE |
Undocumented |
Constant | MISSING_FALLBACK |
Undocumented |
Constant | N |
Undocumented |
Constant | PY_MINOR_VERSION |
Undocumented |
Constant | TYPE_COMMENT_SYNTAX_ERROR |
Undocumented |
Constant | TYPE_IGNORE_PATTERN |
Undocumented |
Constant | _dummy_fallback |
Undocumented |
Undocumented
Parameters | |
source:Union[ | Undocumented |
filename:str | Undocumented |
mode:str | Undocumented |
feature_version:int | Undocumented |
Returns | |
AST | Undocumented |
bytes such as the nul byte are escaped. For example:
>>> b = bytes([102, 111, 111, 10, 0]) >>> s = bytes_to_human_readable_repr(b) >>> print(s) foo
>>> print(repr(s)) 'foo\n\x00'
Parameters | |
b:bytes | Undocumented |
Returns | |
str | Undocumented |
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.
Parameters | |
source:Union[ | Undocumented |
fnam:str | Undocumented |
module:Optional[ | Undocumented |
errors:Optional[ | Undocumented |
options:Optional[ | Undocumented |
Returns | |
MypyFile | Undocumented |
Parse type portion of a type comment (+ optional type ignore).
Return (ignore info, parsed type).
Parameters | |
type_comment:str | Undocumented |
line:int | Undocumented |
column:int | Undocumented |
errors:Optional[ | Undocumented |
assume_str_is_unicode:bool | Undocumented |
Returns | |
Tuple[ | Undocumented |
Parse optional "[code, ...]" tag after "# type: ignore".
Parameters | |
tag:Optional[ | Undocumented |
Returns | |
Optional[ | Undocumented |
Parses a type that was originally present inside of an explicit string, byte string, or unicode string.
For example, suppose we have the type Foo["blah"]
. We should parse the
string expression "blah" using this function.
If assume_str_is_unicode
is set to true, this function will assume that
Foo["blah"]
is equivalent to Foo[u"blah"]
. Otherwise, it assumes it's
equivalent to Foo[b"blah"]
.
The caller is responsible for keeping track of the context in which the
type string was encountered (e.g. in Python 3 code, Python 2 code, Python 2
code with unicode_literals...) and setting assume_str_is_unicode
accordingly.
Parameters | |
expr_string:str | Undocumented |
expr_fallback_name:str | Undocumented |
line:int | Undocumented |
column:int | Undocumented |
assume_str_is_unicode:bool | Undocumented |
Returns | |
ProperType | Undocumented |