Python queue at the bakery: (1, {"loaf":"rye"}) went in fine. Next (1, {"loaf":"corn"}) and I get TypeError: '<' not supported between instances of 'dict' and 'dict'. Everything worked when I only had one kind of bread. Mum considers this evidence.
equal first items in the tuples, so the heap tries to compare the payloads to break the tie. are you trying to promise arrival order to two customers at the same priority?
yes. first come, first baked unless one has a different priority. if I use the loaf name as the tie breaker, baked order becomes corn then rye. our oldest customer is called Zoe and she has opposed this on constitutional grounds.
new empty heap. push (1, 10, rye_dict) then (1, 11, corn_dict). unique increasing second field for each arrival; same priority comes back rye, corn. lower priority NUMBER still comes out first if you add (0, 12, urgent_dict).
tried all three fresh: urgent, rye, corn. I had been poking at the old heap after the failed push like the exception guaranteed it hadn't changed. it already contained two entries. fresh queue for the test, fresh bread for Zoe.