Notices tagged with dictionary
-
Python 3.6 dictionaries are order-preserving. I'm just wondering why there's no way to access dictionary items by index directly. When dictionary retains order, I would love to see it to be accessible just like a list. It would be quite logical.
of course you can get keys() from dict, or items(), but I would think that's inefficient way, if I know I want to access 5th item in dictionary.
#python3 #python36 #python #dict #dictionary #index !python -
Python 3.6 dictionaries are order-preserving. I'm just wondering why there's no way to access dictionary items by index directly. When dictionary retains order, I would love to see it to be accessible just like a list. It would be quite logical.
of course you can get keys() from dict, or items(), but I would think that's inefficient way, if I know I wont to access 5th item in dictionary.
#python3 #python36 #python #dict #dictionary #index !python -
-
-
Saturday, 11-Feb-12 06:06:55 UTC from web