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

Maybe one-liners such as `(a: int, b: int) = do_the_thing(1, 2)` then? #665

Closed
guillaume-chevalier opened this issue Aug 7, 2019 · 3 comments

Comments

@guillaume-chevalier
Copy link

commented Aug 7, 2019

I'd love it to avoid doing this:

    a: int = None
    b: int = None
    a, b = do_the_thing(1, 2)

Supposing that the return type of the callable do_the_thing is unclear or too broad. The context is normal (e.g.: doing this code within the body of a function, not in a function argument list).

Previous issue: #664

@gvanrossum

This comment has been minimized.

Copy link
Member

commented Aug 7, 2019

Please don't keep opening new issues about this. If you want to discuss it further feel free to add comments to the previous (closed) issue. We still read the discussion. But you need to come up with data showing this is a common issue.

@guillaume-chevalier

This comment has been minimized.

Copy link
Author

commented Aug 7, 2019

Closing this one - I thought that removing the ambiguity with the comma (if any) would make it a radically different issue.

@JukkaL

This comment has been minimized.

Copy link
Contributor

commented Aug 7, 2019

Note that you don't need the initializers. This works:

    a: int
    b: int
    a, b = do_the_thing(1, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.