Skip to content

Support per-argument type comment syntax #1738

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

Merged
merged 4 commits into from
Jun 23, 2016

Conversation

ddfisher
Copy link
Collaborator

This will allow mypy to support the per-argument type comment syntax with the fast parser once python/typed_ast#5 lands.

Python 2.7 per-argument type comments will be converted to Python 3 annotations in the typed_ast's conversion module -- this allows them to be mixed with the # type: (...) -> None syntax.

Fixes #1102.

@rwbarton
Copy link
Contributor

Add a test?

@rwbarton
Copy link
Contributor

Also wooo!

@ddfisher
Copy link
Collaborator Author

I knew I was forgetting something! Tests added.

d = None, # type: D
e, # type: E
**kwargs # type: F
):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe test something about the magic * argument just for completeness?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that's a good idea.

@ddfisher
Copy link
Collaborator Author

Added bare * tests.

@gvanrossum gvanrossum merged commit ad9024d into python:master Jun 23, 2016
@ddfisher ddfisher deleted the PR/multiline-function-comments branch June 23, 2016 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants