Set does not show indexes #1183
Replies: 2 comments
-
While implementing this is straightforward enough, I'm not sure it's such a good idea anymore. Unlike dicts, Python sets don't preserve insertion order, and don't have any inherent order otherwise. There is, of course, the enumeration order, but it's not guaranteed to be stable in any sense. This matters if the user does "Add Watch" on one of the set elements - if we use the (random) enumeration order, the corresponding Watch entry will jump from element to element as the set is modified. On the other hand, when object IDs are used as keys, adding a given set entry to Watch will persist in visualizing that specific entry for as long as it remains in the set. One catch is that Add Watch is not actually supported for sets at all right now! However, there's no reason why it couldn't be, in principle. |
Beta Was this translation helpful? Give feedback.
-
Moving this issue to discussion as an enhancement request for comments and upvotes. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions