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

Stop changing return type annotations to tuples #2384

Merged
merged 7 commits into from Aug 26, 2021

Commits on Jul 20, 2021

  1. Stop changing parenthesized return annotations to tuples

    This fixes a bug where a trailing comma would be added to a
    parenthesized return annotation changing its type to a tuple.
    Here's one case where this bug shows up:
    
    ```
    def spam() -> (
        this_is_a_long_type_annotation_which_should_NOT_get_a_trailing_comma
    ):
        pass
    ```
    
    The root problem was that the type annotation was treated as if it was
    a parameter & import list (is_body=True to linegen::bracket_split_build_line)
    where a trailing comma is usually fine. Now there's another check in the
    aforementioned function to make sure the body it's operating on isn't
    a return annotation before truly adding a trailing comma.
    ichard26 committed Jul 20, 2021
    Copy the full SHA
    1495f48 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2021

  1. Cover more edge cases

    ichard26 committed Jul 30, 2021
    Copy the full SHA
    99bceb1 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2021

  1. Copy the full SHA
    58a1859 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2021

  1. Copy the full SHA
    3d0fd95 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2021

  1. Copy the full SHA
    7464ff1 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    b651b64 View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2021

  1. Copy the full SHA
    22fe2c6 View commit details
    Browse the repository at this point in the history