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

Add a Starlark set data type #290

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

tetromino
Copy link
Collaborator

Modeled on the Python 3 set type and the existing implementations in Go, Rust, and the proposed one for Java, with the following differences:

  • set literals and set comprehensions not supported (unlike python3)
  • copy() method not supported (unlike python3) because we do not have it on lists or dictionaries.
  • comparison operators not supported (unlike starlark-go and python3)
  • update() method supported (unlike starlark-go)
  • isdisjoint(),intersection_update(), difference_update(), symmetric_difference_update() method supported (unlike starlark-go and starlark-rust)
  • multiple-argument form of union(), intersection(), difference() and corresponding _update methods supported (unlike starlark-go and starlark-rust).

Fixes #264

@adonovan @stepancheg FYI

Modeled on the Python 3 set type and the existing implementations in Go,
Rust, and the proposed one for Java, with the following differences:

* set literals and set comprehensions *not* supported (unlike python3)
* `copy()` method *not* supported (unlike python3) because we do not
  have it on lists or dictionaries.
* comparison operators *not* supported (unlike starlark-go and python3)
* `update()` method supported (unlike starlark-go)
* `isdisjoint()`,`intersection_update()`, `difference_update()`,
  `symmetric_difference_update()` method supported (unlike starlark-go
  and starlark-rust)
* multiple-argument form of `union()`, `intersection()`, `difference()`
  and corresponding _update methods supported (unlike starlark-go and
  starlark-rust).

Fixes bazelbuild#264
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.

proposal: add a set data type
1 participant