[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

what the hell python, why does it change the ordering?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 19
Thread images: 1

File: Untitled.jpg (27KB, 586x154px) Image search: [Google]
Untitled.jpg
27KB, 586x154px
what the hell python, why does it change the ordering?
>>
>>57771696
>what the hell python, why does it change the ordering?
Dicts do not have a defined order
>>
>>57771696
>ordering
>in a dict
>>
JUST
>>
Do you know what an associative array is?
>>
>>57771696
>csdegree.jpg
>>
"beta" and "bet" don't have the same hash value, and a dict is just a hash table.

Why do you care about the order of a dict anyways?
>>
Also, there's an ordered dict, aptly called OrderedDict, so use that.
>>
>>57771696
https://docs.python.org/2/library/stdtypes.html#dict.items
>>
>>57771771
yeah i guess i have to
>>
>>57771696
Why do you need ordering in a dictionary? Sounds like shoddy code...
>>
>>57771771
soon all dicts will be ordered
>>
>>57771866
so it prints stuff in the order that the dict is created/modified
>>
>>57771941
why?
>>
>>57771947
cuz i fucking feel like it that's why
>>
>>57771958
You want a CaterToMyWhimsDict then
>>
>>57771941
You're supposed to store timestamps for that. Relying on the ordering of the dictionary is extremely sloppy.
>>
>tfw /g/ is this easily trolled
>>
>>57771895
Your mom already ordered my dict last night.
Thread posts: 19
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.