27 Jun
2020
27 Jun
'20
6:57 a.m.
On Sat, Jun 27, 2020 at 06:09:02PM +1200, Greg Ewing wrote:
On 27/06/20 4:25 pm, Steven D'Aprano wrote:
Seriously, I genuinely thought that the existing behaviour was the opposite and that `add` unconditionally added the element. "Last seen wins".
The fact that you haven't noticed until now suggests that you've never written any code that depends on the difference.
No, because I've tried avoid code that would behave differently in those cases. I did find one thing... I was removing an unorded sequence by dropping the elements into a set then converting back to a list, and documented it as "last seen wins" in the case of duplicates. -- Steven