from urllib.parse import urlencode
values = {'one': 'one', 'two': 'two', 'three': 'three', 'four': 'four',
    'five': 'five', 'six': 'six', 'seven': 'seven'}
sorted_values = sorted(list(values.items()), key=lambda val: val[0])
confusing python urlencode order