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

Support type annotations #946

Merged
merged 2 commits into from
Feb 3, 2021
Merged

Conversation

vladmos
Copy link
Member

@vladmos vladmos commented Jan 29, 2021

The commit allows using Python3-like type annotations for function parameters and return values:

def f(x: int, y: str) -> List[bool]:
    pass

Fixes #900

@vladmos vladmos merged commit 9c80db6 into bazelbuild:master Feb 3, 2021
@vladmos vladmos deleted the type_annotations branch February 3, 2021 11:29
@sluongng
Copy link

sluongng commented Feb 4, 2021

Is this syntax compatible with Bazel?

I take it that here Type annotation can be parsed, but is not strongly enforced/checked right?

@vladmos
Copy link
Member Author

vladmos commented Feb 4, 2021

Correct, Bazel currently doesn't support type annotations, and Buildifier doesn't enforce them in any way, this is just for compatibility with other Starlark dialects that use Python3-like type annotations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support type annotations
3 participants