-
Notifications
You must be signed in to change notification settings - Fork 212
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
FR: Support More Methods for type set
#492
Comments
+1 |
These operations are all compatible with Python and consistent with starlark-go's notion of |
I'm looking for something to work on, so I've started implementing this. Feel free to assign this issue to me and I'll try to have a PR open soon 👍 |
@SamWheating Thanks for your work! Can you please add the following useful methods as well? union() -> a | b
intersection() -> a & b
difference() -> a - b
symmetric_difference() -> a ^ b
issubset() -> a <= b
issuperset() -> a >= b
|
The |
Yes. It would be nice to have those methods, 'cause the symbols are initially elusive in understanding. @adonovan
|
Good idea, I will add those functions as well as the infix operators in the next few days. |
As per PYthon doc : https://docs.python.org/3.10/library/stdtypes.html#set-types-set-frozenset
The five methods should be added:
Now it's too hard to use, for example, add() can only be implemented via helper like:
The text was updated successfully, but these errors were encountered: