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

Spec is unclear on / operator #31

Closed
illicitonion opened this issue Feb 4, 2019 · 2 comments
Closed

Spec is unclear on / operator #31

illicitonion opened this issue Feb 4, 2019 · 2 comments

Comments

@illicitonion
Copy link
Contributor

The spec states that / is a binary operator (a Binop), but doesn't give it any meaning (it's not considered an Arithmetic operation.

It is included as an Augmented assignment (/=), but without behavioural specification.

These all appear in the grammar reference.

Should / be removed from the grammar, or should its behaviour be specified?

@laurentlb
Copy link
Contributor

As in Python 3, // should be integer division and / should be float division. However, the spec doesn't define floats at the moment.

Starlark-Go implementation can support floats behind a flag. If you don't support floats, you should raise an error for the / operator.

Keeping it in the grammar can help tools (e.g. formatter, linter) handle it.

@alandonovan
Copy link
Contributor

This is addressed by #119, which should hopefully be committed later today.

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

No branches or pull requests

3 participants