grantjenks / blue

The slightly less uncompromising Python code formatter.
https://blue.readthedocs.io/
Other
393 stars 21 forks source link

Don't require blank lines after @typing.overload ellipses #47

Open warsaw opened 3 years ago

warsaw commented 3 years ago

I have a PR that uses @typing.overload. You'll notice that in the stdlib documentation, there are no blank lines after the ellipsis in the overload definitions. @gvanrossum even says that they don't traditionally do this. However, without the blank lines, black (and thus blue) complains. Perhaps blue can do better.

E.g.

@overload
def process(response: None) -> None:
    ...
@overload
def process(response: int) -> tuple[int, str]:
    ...
@overload
def process(response: bytes) -> str:
    ...
def process(response):
    <actual implementation>