Fixed for mypy 0.501.
The List and Dict types are no longer implicitly available. They must be imported from typing. Type annotations must appear before the doc comment in a function. Also fix type errors in these functions that weren't detected before.
This commit is contained in:
@@ -14,6 +14,13 @@ from cdsl.instructions import Instruction # noqa
|
||||
from cdsl.operands import Operand # noqa
|
||||
from cdsl.typevar import TypeVar # noqa
|
||||
|
||||
# The typing module is only required by mypy, and we don't use these imports
|
||||
# outside type comments.
|
||||
try:
|
||||
from typing import List # noqa
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
def gen_formats(fmt):
|
||||
# type: (srcgen.Formatter) -> None
|
||||
|
||||
Reference in New Issue
Block a user