-
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 item assignment #79
Comments
@rspeer if you would support the addition of this feature, I would like to implement it. |
This would require changing the behavior of multiple other methods.
|
I really don't understand these questions. Python already has a mutable ordered data structure - Besides, it's already possible to remove items from an ordered set. All I'm asking for is a way to delete items by index instead of value. |
You know, there's a way to get an open source developer to consider your feature, and the above comment is not it. Please think through the following case:
|
Why not? I explained why I don't understand your questions, and answered them to the best of my ability. What did I do wrong? I'll admit that I overlooked this problem:
In this case, I'd just throw an exception.
Again, I don't understand the question. Why would you need to construct a new OrderedSet? |
The part that I objected to was "Why is that even a question?" followed by an attempt to explain to me what my library does. The requirements are clearer now:
Looking at the code, I notice that I merged an implementation of |
I still don't really understand what I did to offend you, and I was about to inquire about it in more detail, but ultimately I've decided it would only end up derailing this conversation further. I'm sorry I came across as rude; I have to admit I was a bit miffed when the first response to my 6 month old problem was some... let's say, odd questions. So to wrap this up, let's review the requirements:
|
I agree with @Aran-Fey's breakdown. It might be simpler to not support |
I think the only reasonable thing to do with |
Hi, Would you be interested in making a PR for adding these features? |
In my fork of yours, I managed to implement |
If you wish so, you may implement Please note that I wanted to clean and reorder the commit history before making #92 but I didn't do this before I published my fork (oops) so your commit history on master is different then mine (sorry about that, I'm not intending to force push to master again). |
Since
OrderedSet
supports indexing, it's natural to assume that assignments anddel
would work as well, but they don't:There's an easy workaround for
del
(s.remove(s[0])
), but not for item assignments. As far as I can tell, there is no way to reorder items at all, so it's impossible to replace an element with another one (while preserving its index).The text was updated successfully, but these errors were encountered: