From: Richard Si <63936253+ichard26@users.noreply.github.com> Date: Thu, 26 Aug 2021 01:32:27 +0000 (-0400) Subject: Stop changing return type annotations to tuples (#2384) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/8a59528c2d8ae1ef5f366039c728614aaf1a470b?hp=8a59528c2d8ae1ef5f366039c728614aaf1a470b Stop changing return type annotations to tuples (#2384) 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. ---