sort dict items when making like tuple