-
Notifications
You must be signed in to change notification settings - Fork 47
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 an option to create immutable set #35
Comments
I'm worried about scope creep. An immutable version of OrderedSet would clearly be useful in a few cases, but maybe it should just be a different package. There's a lot of methods of OrderedSet that it wouldn't need. |
But that means that lot's of code would be duplicated. Isn't possible to create a base class to implement all common functionality and create two subclasses? |
I'm really not interested in writing extra code for this use case. When you need a small immutable sequence that you can use as a default argument, a tuple should do just fine. |
Hello, rather than this being a flag on the original I am happy to put up a PR for this, including comprehensive tests and type hints, given your blessing. (It's okay if you don't want to commit to it at this point - if you'd like to see the PR first before accepting the overall idea, let me know and I'd be happy to do so.) Why do I care about this? I'm one of the maintainers of Pex and Pants. For the build tool Pants, our caching model depends on stable iteration and immutability. (Possible further context: Python is considering PEP 603 to add a builtin |
I need to pass ordered set as function default argument, therefore, I need an immutable set. Please provide a way to create an immutable set.
The text was updated successfully, but these errors were encountered: