Hacker Newsnew | past | comments | ask | show | jobs | submit | zurtex's commentslogin

No, OrderedDict has it's own C implementation which was created just before it was decided that dict would preserve order across iteration.

Further there is a big difference, regular dict preserves order across iteration but OrderedDict treats order up to equality.

I.e. this returns True:

    {1: 1, 2: 2} == {2: 2, 1: 1}
Where as this returns False:

    OrderedDict({1: 1, 2: 2}) == OrderedDict({2: 2, 1: 1})
To make that difference speedy it needs to be done on the C level.


Also ordereddicts provide methods to move items to the start or end, and remove items specifically at the start or end, not so for regular dicts.


dict has popitem for removing at the end. That used to be arbitrary, but now it (de facto) means last-inserted.


For the former, I realize that's how it's done now, but there's nothing forcing it to stay that way.

For the latter issue, as explained above, can't they just implement a replacement __eq__ only for OrderedDict, and still re-use the new dict implementation?

Similarly, any subtle difference can be shimmed on top of the new implementation inside Python, no?


Depends what OrderedDict was being used for. If used for some of the obscure ordering features, replacement with dict + a shim might be a slowdown.


Google photos can both search text: https://9to5google.com/2019/08/22/google-photos-text-search/

And transcribe text with Google Lens


Edit: Removed my comment as it conflicted with the guidelines


This is against Hacker News guidelines:

"Please don't make insinuations about astroturfing. It degrades discussion and is usually mistaken. If you're worried, email us and we'll look at the data."

https://news.ycombinator.com/newsguidelines.html


Thanks, I'm new to commenting here, I don't see a delete but so I just edited my comment away.


Do you think the author is fake? Go read his comment history: https://news.ycombinator.com/threads?id=npmaile


The question is simply posed but unfortunately is rather difficult to answer because it depends what you mean by fake.

Accounts with a history are very valuable to companies in the business of "creating organic public support".

Also an author can be part of a community bit have a motivation to drive a discussion in a certain direction.

In either case it doesn't mean the post, the author, or the history are "fake" but it can mean there is some level of astroturfing going on.

Anyway I've been informed the guidelines prohibit such insinuations and I can understand why as they are an easy accusation but don't lend towards evidence based or productive discussions so I've removed my comment.


Certainly it's an annoying trait to claim that a statement you disagree with is disingenuous/insincere.


Raymond has been consistent in saying Python 3.6.1 was the release where Python 3 became better than Python 2. That was March 21, 2017, and we're now in Python 3.7.4.

I appreciate the general point that that's far more recent than Python 3s initial release but it's also a large exaggeration to say "until this most current release".

Also to understand why it took so long is because Python 2 kept improving after Python 3s release. Python 2.7 was a great release and many further features from Python 3 got backported in it's 2.7.x point release.


Sorry, I misremembered. 3.8 is the first one he said is a clear winner: https://twitter.com/raymondh/status/1167218640095043586


2017 is a lot more recent than 2008 (Py 3.0).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: