Module implementing a node visitor for function type annotations.
None |
AnnotationsFutureVisitor | Class implementing a node visitor to check __future__ imports. |
None |
Class implementing a node visitor to check __future__ imports.
SimplifiedTypes |
SimplifyableTypes |
None |
AnnotationsFutureVisitor | Constructor |
__processAnnotation | Private method to process the given annotations. |
getSimplifiedTypes | Public method Public method to get the list of detected simplified types. |
getTypingImports | Public method to get the list of typing imports. |
hasSimplifiedTypes | Public method to check, if the analyzed code includes annotations with simplified types. |
hasTypingImports | Public method to check, if the analyzed code includes typing imports. |
importsFutureAnnotations | Public method to check, if the analyzed code uses future annotation. |
visit_AnnAssign | Public method to check type annotations. |
visit_Attribute | Public method to record simplifiable names. |
visit_Import | Public method to check imports for typing related stuff. |
visit_ImportFrom | Public method to detect the 'from __future__ import annotations' import if present. |
visit_arg | Public method to check argument annotations. |
None |
Constructor
Private method to process the given annotations.
Public method Public method to get the list of detected simplified types.
Public method to get the list of typing imports.
Public method to check, if the analyzed code includes annotations with simplified types.
Public method to check, if the analyzed code includes typing imports.
Public method to check, if the analyzed code uses future annotation.
Public method to check type annotations.
Public method to record simplifiable names.
If 'import typing' or 'import typing as t' is used, add simplifiable names that were used later on in the code.
Public method to check imports for typing related stuff.
This looks like: import typing or import typing as t
typing or t will be added to the list of typing aliases.
Public method to detect the 'from __future__ import annotations' import if present.
If 'from typing import ...' is used, add simplifiable names that were imported.
Public method to check argument annotations.