Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Make can_be_incomplete kwonly
  • Loading branch information
srittau committed May 16, 2025
commit 804f2cb736f09e18c90f8052b03cb7506dc37cbe
4 changes: 2 additions & 2 deletions mypy/stubgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def _get_func_args(self, o: FuncDef, ctx: FunctionContext) -> list[ArgSig]:
default = "..."
if arg_.initializer:
if not typename:
typename = self.get_str_type_of_node(arg_.initializer, False)
typename = self.get_str_type_of_node(arg_.initializer, can_be_incomplete=False)
potential_default, valid = self.get_str_default_of_node(arg_.initializer)
if valid and len(potential_default) <= 200:
default = potential_default
Expand Down Expand Up @@ -1305,7 +1305,7 @@ def is_private_member(self, fullname: str) -> bool:
parts = fullname.split(".")
return any(self.is_private_name(part) for part in parts)

def get_str_type_of_node(self, rvalue: Expression, can_be_incomplete: bool = True) -> str:
def get_str_type_of_node(self, rvalue: Expression, *, can_be_incomplete: bool = True) -> str:
rvalue = self.maybe_unwrap_unary_expr(rvalue)

if isinstance(rvalue, IntExpr):
Expand Down