This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author remi.lapeyre
Recipients Lyn Levenick, SilentGhost, elliot.gorokhovsky, lukasz.langa, lys.nikolaou, ned.deily, remi.lapeyre, rhettinger, xtreak, zach.ware
Date 2019-03-07.09:43:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551951814.29.0.147542534452.issue36218@roundup.psfhosted.org>
In-reply-to
Content
> Rémi, are you saying there are failing tests currently in the master related to this bug?

No, you are right there is no tests for this code path and there is no tests on master related to this bug as far as I can tell.

I think the issue comes from https://github.com/python/cpython/blob/master/Objects/listobject.c#L2307-L2310, there is an early exit from the loop when keys don't have all the same type, but it is wrong to still think they are all tuples since:
  - they don't all have the same type
  - we did not check all elements in the list anyway 

The code at https://github.com/python/cpython/blob/master/Objects/listobject.c#L2307-L2310 should be guarded by the `if (keys_are_all_same_type)`. I opened a PR to add the tests from Lyn Levenick and the proposed fix.
History
Date User Action Args
2019-03-07 09:43:34remi.lapeyresetrecipients: + remi.lapeyre, rhettinger, ned.deily, SilentGhost, lukasz.langa, zach.ware, elliot.gorokhovsky, lys.nikolaou, xtreak, Lyn Levenick
2019-03-07 09:43:34remi.lapeyresetmessageid: <1551951814.29.0.147542534452.issue36218@roundup.psfhosted.org>
2019-03-07 09:43:34remi.lapeyrelinkissue36218 messages
2019-03-07 09:43:34remi.lapeyrecreate