Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant condition from has_magic_trailing_comma #4023

Merged
merged 2 commits into from Nov 8, 2023

Commits on Nov 4, 2023

  1. Copy the full SHA
    11a5cb8 View commit details
    Browse the repository at this point in the history
  2. Remove redundant condition from has_magic_comma

    The second `if` cannot be true at its execution point, because it is
    already covered by the first `if`. The condition
    `comma.parent.type == syms.subscriptlist` always holds if
    `closing.parent.type == syms.trailer` holds, because `subscriptlist`
    only appears inside `trailer` in the grammar:
    
    ```
    trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
    subscriptlist: (subscript|star_expr) (',' (subscript|star_expr))* [',']
    ```
    bluetech committed Nov 4, 2023
    Copy the full SHA
    ac21ded View commit details
    Browse the repository at this point in the history