Skip to content

Commit 01639e2

Browse files
stepanchegfacebook-github-bot
authored andcommitted
Use ... in Display for Callable
Summary: Like [Python does](https://docs.python.org/3/library/typing.html#annotating-callables). Reviewed By: IanChilds Differential Revision: D63681890 fbshipit-source-id: a53a5f22beaee04631eff910e759d5244a7e59e5
1 parent 5bfc3d5 commit 01639e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

starlark/src/typing/callable.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ impl Display for TyCallable {
8383
write!(f, "typing.Callable")?;
8484
} else {
8585
write!(f, "typing.Callable[")?;
86-
if let Some(pos) = self.params().all_required_pos_only() {
86+
if self.params().is_any() {
87+
write!(f, "...")?;
88+
} else if let Some(pos) = self.params().all_required_pos_only() {
8789
write!(f, "[")?;
8890
for (i, p) in pos.iter().enumerate() {
8991
if i != 0 {

0 commit comments

Comments
 (0)