> On 13 Jul 2020, at 18:56, Paul Moore <[email protected]> wrote:
> 
> On Mon, 13 Jul 2020 at 18:42, Barry Scott <[email protected]> wrote:
> 
>> On 13 Jul 2020, at 05:55, Christopher Barker <[email protected]> wrote:
>> 
>> well, sure, though I have to say that I think that that's an unfortunate 
>> confusing thing about python dicts. IN fact, I doubt there are many uses at 
>> all for dict.keys() -- most uses can jsut use the dict.
>> 
>> I use key() all the time to sort the keys before printing.
>> 
>> for name in sorted(dict.key()):
>>    print(name, dict[name)
> 
> Why not just use sorted(dict)?

Ooo shiny I do like that version of sorted(d).

I got curious and found that iter(d) is the same as iter(d.keys())

Barry
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/J4S62GNXB4J7W5AVAQFDVCC2NRP4AMRG/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to