-
Notifications
You must be signed in to change notification settings - Fork 219
Closed
astral-sh/ruff
#22624Milestone
Description
Summary
In stubs it may be useful to declare an argument as having a default without specifying the actual default value. For example:
def foo(x: AnyStr, y: AnyStr = ...) -> AnyStr: ...
I argue, in the same vein as #339, that if TYPE_CHECKING sections are very stub-file-like. Therefore, I suggest to allow assigning ... (ellipsis) as a parameter default value. At least mypy is also fine with this.
Admittedly, mypy just allows ellipsis to be a parameter default everywhere. I'm not sure that's a good idea, really. mypy gist: https://gist.github.com/mypy-play/41532e8350478fd1a0b4fa6ee764171b
Version
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels