[issue39178] Should we make dict not accept a sequence of sets?

2020-01-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: "should dict preemptively make sure it doesn't accept a sequence of sets" No. The person on StackOverflow made a mistake in their code: they used an unordered data structure (set) instead of an ordered data structure (tuple): dict({i,j} for i,j in

[issue39178] Should we make dict not accept a sequence of sets?

2020-01-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a very special case. I think it is better to leave it to third-party linters. Actually it is so uncommon, that I have doubts that even linters will want to handle it. -- nosy: +serhiy.storchaka ___

[issue39178] Should we make dict not accept a sequence of sets?

2020-01-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +inada.naoki, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39178] Should we make dict not accept a sequence of sets?

2020-01-01 Thread Adi
New submission from Adi : While writing this SO answer (https://stackoverflow.com/a/59552970/1453822) I came to think, should dict preemptively make sure it doesn't accept a sequence of sets (given that it may lead to wrong output in the good case, and miserably fail in the worst case)?