Report [`UnsupportedSyntaxError`]s for each starred element in `expr` if it is an unparenthesized tuple. This method can be used to check for tuple unpacking in `return`, `yield`, and `for` statements, which are only allowed after [Python 3.8] and [Python 3.9], respectively. [Python 3.8]: https://github.com/python/cpython/issues/76298 [Python 3.9]: https://github.com/python/cpython/issues/90881
(&mut self, expr: &Expr, kind: UnsupportedSyntaxErrorKind)
| 501 | /// [Python 3.8]: https://github.com/python/cpython/issues/76298 |
| 502 | /// [Python 3.9]: https://github.com/python/cpython/issues/90881 |
| 503 | pub(super) fn check_tuple_unpacking(&mut self, expr: &Expr, kind: UnsupportedSyntaxErrorKind) { |
| 504 | if kind.is_supported(self.options.target_version) { |
| 505 | return; |
| 506 | } |
| 507 | |
| 508 | let Expr::Tuple(ast::ExprTuple { |
| 509 | elts, |
| 510 | parenthesized: false, |
| 511 | .. |
| 512 | }) = expr |
| 513 | else { |
| 514 | return; |
| 515 | }; |
| 516 | |
| 517 | for elt in elts { |
| 518 | if elt.is_starred_expr() { |
| 519 | self.add_unsupported_syntax_error(kind, elt.range()); |
| 520 | } |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | /// Parses a `raise` statement. |
| 525 | /// |
no test coverage detected