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

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

Open
warsaw opened this issue Apr 14, 2021 · 0 comments
Open

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

warsaw opened this issue Apr 14, 2021 · 0 comments
Labels
formatting-idea Formatting ideas

Comments

@warsaw
Copy link
Collaborator

warsaw commented Apr 14, 2021

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>
@warsaw warsaw added the formatting-idea Formatting ideas label Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatting-idea Formatting ideas
Projects
None yet
Development

No branches or pull requests

1 participant