Skip to content

Commit

Permalink
Address Alex's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Oct 15, 2024
1 parent 4f7fad4 commit b905919
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions crates/red_knot_python_semantic/resources/mdtest/unpacking.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ reveal_type(b) # revealed: Literal[2]
# TODO: Remove 'not-iterable' diagnostic
[a, *b, c, d] = (1, 2) # error: "Object of type `None` is not iterable"
reveal_type(a) # revealed: Literal[1]
# TODO: Should be List[Any] once support for assigning to starred expression is added
# TODO: Should be list[Any] once support for assigning to starred expression is added
reveal_type(b) # revealed: @Todo
reveal_type(c) # revealed: Literal[2]
reveal_type(d) # revealed: Unknown
Expand All @@ -95,7 +95,7 @@ reveal_type(d) # revealed: Unknown
```py
[a, *b, c] = (1, 2) # error: "Object of type `None` is not iterable"
reveal_type(a) # revealed: Literal[1]
# TODO: Should be List[Any] once support for assigning to starred expression is added
# TODO: Should be list[Any] once support for assigning to starred expression is added
reveal_type(b) # revealed: @Todo
reveal_type(c) # revealed: Literal[2]
```
Expand All @@ -106,7 +106,7 @@ reveal_type(c) # revealed: Literal[2]
# TODO: Remove 'not-iterable' diagnostic
[a, *b, c] = (1, 2, 3) # error: "Object of type `None` is not iterable"
reveal_type(a) # revealed: Literal[1]
# TODO: Should be List[int] once support for assigning to starred expression is added
# TODO: Should be list[int] once support for assigning to starred expression is added
reveal_type(b) # revealed: @Todo
reveal_type(c) # revealed: Literal[3]
```
Expand All @@ -117,7 +117,7 @@ reveal_type(c) # revealed: Literal[3]
# TODO: Remove 'not-iterable' diagnostic
[a, *b, c, d] = (1, 2, 3, 4, 5, 6) # error: "Object of type `None` is not iterable"
reveal_type(a) # revealed: Literal[1]
# TODO: Should be List[int] once support for assigning to starred expression is added
# TODO: Should be list[int] once support for assigning to starred expression is added
reveal_type(b) # revealed: @Todo
reveal_type(c) # revealed: Literal[5]
reveal_type(d) # revealed: Literal[6]
Expand All @@ -130,7 +130,7 @@ reveal_type(d) # revealed: Literal[6]
[a, b, *c] = (1, 2, 3, 4) # error: "Object of type `None` is not iterable"
reveal_type(a) # revealed: Literal[1]
reveal_type(b) # revealed: Literal[2]
# TODO: Should be List[int] once support for assigning to starred expression is added
# TODO: Should be list[int] once support for assigning to starred expression is added
reveal_type(c) # revealed: @Todo
```

Expand Down Expand Up @@ -222,7 +222,7 @@ reveal_type(b) # revealed: LiteralString
# TODO: Remove 'not-iterable' diagnostic
(a, *b, c, d) = "ab" # error: "Object of type `None` is not iterable"
reveal_type(a) # revealed: LiteralString
# TODO: Should be List[LiteralString] once support for assigning to starred expression is added
# TODO: Should be list[LiteralString] once support for assigning to starred expression is added
reveal_type(b) # revealed: @Todo
reveal_type(c) # revealed: LiteralString
reveal_type(d) # revealed: Unknown
Expand All @@ -233,7 +233,7 @@ reveal_type(d) # revealed: Unknown
```py
(a, *b, c) = "ab" # error: "Object of type `None` is not iterable"
reveal_type(a) # revealed: LiteralString
# TODO: Should be List[Any] once support for assigning to starred expression is added
# TODO: Should be list[Any] once support for assigning to starred expression is added
reveal_type(b) # revealed: @Todo
reveal_type(c) # revealed: LiteralString
```
Expand All @@ -244,7 +244,7 @@ reveal_type(c) # revealed: LiteralString
# TODO: Remove 'not-iterable' diagnostic
(a, *b, c) = "abc" # error: "Object of type `None` is not iterable"
reveal_type(a) # revealed: LiteralString
# TODO: Should be List[LiteralString] once support for assigning to starred expression is added
# TODO: Should be list[LiteralString] once support for assigning to starred expression is added
reveal_type(b) # revealed: @Todo
reveal_type(c) # revealed: LiteralString
```
Expand All @@ -255,7 +255,7 @@ reveal_type(c) # revealed: LiteralString
# TODO: Remove 'not-iterable' diagnostic
(a, *b, c, d) = "abcdef" # error: "Object of type `None` is not iterable"
reveal_type(a) # revealed: LiteralString
# TODO: Should be List[LiteralString] once support for assigning to starred expression is added
# TODO: Should be list[LiteralString] once support for assigning to starred expression is added
reveal_type(b) # revealed: @Todo
reveal_type(c) # revealed: LiteralString
reveal_type(d) # revealed: LiteralString
Expand All @@ -268,6 +268,6 @@ reveal_type(d) # revealed: LiteralString
(a, b, *c) = "abcd" # error: "Object of type `None` is not iterable"
reveal_type(a) # revealed: LiteralString
reveal_type(b) # revealed: LiteralString
# TODO: Should be List[int] once support for assigning to starred expression is added
# TODO: Should be list[int] once support for assigning to starred expression is added
reveal_type(c) # revealed: @Todo
```
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ where
});
}
self.visit_expr(target);
self.current_assignment = None;
}
self.current_assignment = None;
}
ast::Stmt::AnnAssign(node) => {
debug_assert!(self.current_assignment.is_none());
Expand Down

0 comments on commit b905919

Please sign in to comment.