|
55 | 55 | from mypy.nodes import (
|
56 | 56 | Expression, IntExpr, UnaryExpr, StrExpr, BytesExpr, NameExpr, FloatExpr, MemberExpr, TupleExpr,
|
57 | 57 | ListExpr, ComparisonExpr, CallExpr, ClassDef, MypyFile, Decorator, AssignmentStmt,
|
58 |
| - IfStmt, ImportAll, ImportFrom, Import, FuncDef, FuncBase, ARG_STAR, ARG_STAR2, ARG_NAMED |
| 58 | + IfStmt, ImportAll, ImportFrom, Import, FuncDef, FuncBase, |
| 59 | + ARG_STAR, ARG_STAR2, ARG_NAMED, ARG_NAMED_OPT, |
59 | 60 | )
|
60 | 61 | from mypy.stubgenc import parse_all_signatures, find_unique_signatures, generate_stub_for_c_module
|
61 | 62 | from mypy.stubutil import is_c_module, write_header
|
@@ -261,7 +262,7 @@ def visit_func_def(self, o: FuncDef) -> None:
|
261 | 262 | name = var.name()
|
262 | 263 | init_stmt = arg_.initialization_statement
|
263 | 264 | if init_stmt:
|
264 |
| - if kind == ARG_NAMED and '*' not in args: |
| 265 | + if kind in (ARG_NAMED, ARG_NAMED_OPT) and '*' not in args: |
265 | 266 | args.append('*')
|
266 | 267 | typename = self.get_str_type_of_node(init_stmt.rvalue, True)
|
267 | 268 | arg = '{}: {} = ...'.format(name, typename)
|
|
0 commit comments