Skip to content

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