Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Tokenize function and parameter annotations#228

Merged
winstliu merged 6 commits intomasterfrom
wl-function-annotations
Jan 25, 2018
Merged

Tokenize function and parameter annotations#228
winstliu merged 6 commits intomasterfrom
wl-function-annotations

Conversation

@winstliu
Copy link
Copy Markdown
Contributor

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Tokenizes optional function and parameter annotations in accordance with PEP-3107.

Alternate Designs

I looked at the three prior attempts.
#84 did not add support for function return-value annotations
#88 did not add highlighting for annotations
#95 when I was testing it didn't appear to support function return-value annotations

Benefits

Fully supports PEP-3107, which has been in effect since Python 3.0 was released.

Possible Drawbacks

This PR does include some minor relaxations in function definition syntax in order to more easily accommodate annotations. These changes also don't apply at all to Python 2 files.

Applicable Issues

Fixes #68
Supersedes and closes #84
Supersedes and closes #88
Supersedes and closes #95

@corylation @berdario @pchaigno many thanks for your PRs.

@corylation @berdario @pchaigno @MaximSokolov I'd like to merge this soon (probably by Tuesday/Wednesday), but if you have any issues with the scope names I'm using please tell me!

@winstliu
Copy link
Copy Markdown
Contributor Author

Oh yeah, here's a picture.
python-annotations

Wliu added 2 commits January 22, 2018 20:03
It's a bit too complicated to do now with annotations in the mix.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support syntax highlighting for function annotations (PEP 3107)

2 participants