mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-08 21:55:26 +00:00
fix for Lib/test/test_future_stmt/test_future.py: test_annotations
This commit is contained in:
parent
649fdd4be9
commit
51b5f80ae3
1 changed files with 1 additions and 6 deletions
|
@ -379,12 +379,7 @@ impl<'a> Unparser<'a> {
|
||||||
}
|
}
|
||||||
Expr::Subscript(crate::ExprSubscript { value, slice, .. }) => {
|
Expr::Subscript(crate::ExprSubscript { value, slice, .. }) => {
|
||||||
self.unparse_expr(value, precedence::ATOM)?;
|
self.unparse_expr(value, precedence::ATOM)?;
|
||||||
let mut lvl = precedence::TUPLE;
|
let lvl = precedence::TUPLE;
|
||||||
if let Expr::Tuple(crate::ExprTuple { elts, .. }) = slice.as_ref() {
|
|
||||||
if elts.iter().any(|expr| expr.is_starred_expr()) {
|
|
||||||
lvl += 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
self.p("[")?;
|
self.p("[")?;
|
||||||
self.unparse_expr(slice, lvl)?;
|
self.unparse_expr(slice, lvl)?;
|
||||||
self.p("]")?;
|
self.p("]")?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue