Live data from Hacker News

Migrating to Python 3 with pleasure

github.com

1–10 of 181 posts

Re: Migrating to Python 3 with pleasure

#8
I've moved to python 3 over the past couple of months, after resisting for the better part of a decade. I like it.

One surprising thing I learned from this document is that dicts now iterate in assignment order, not hash order. That's going to break some code for people.

Re: Migrating to Python 3 with pleasure

#9

I've moved to python 3 over the past couple of months, after resisting for the better part of a decade. I like it. One surprising thing I learned from this document is that dicts now iterate in assignment order, not hash order. That's going to break some code for people.

Dicts never had an iteration order, though. If you relied on dicts iterating in order, you were kind of asking for it.

Re: Migrating to Python 3 with pleasure

#10
post #9

I've moved to python 3 over the past couple of months, after resisting for the better part of a decade. I like it. One surprising thing I learned from this document is that dicts now iterate in assignment order, not hash order. That's going to break some code for people.

Dicts never had an iteration order, though. If you relied on dicts iterating in order, you were kind of asking for it.

I believe newer Python versions have at least deterministic iteration order (correct me if I'm wrong), while some previous ones had a non-deterministic one (non-deterministic between mutiple invocations of the interpreter). But there is also OrderedDict which iterates in assignment order.
Post reply on HN