[issue45908] dict.fromkeys insertion order

2021-11-27 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue45908] dict.fromkeys insertion order

2021-11-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What else can it be? dict.fromkeys() adds keys in the order of obtaining them, and it obtains them by iterating its argument. If we need a special note here, we need a special note for list(), tuple(), filter(), enumerate() and all other functions which co

[issue45908] dict.fromkeys insertion order

2021-11-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the suggestion but I’m going to decline. We has many APIS that consume an iterable and all of them do so In iteration order. Even the regular dict() constructor takes an iterable of tuples and adds them in iteration order. Also, I’m not concer

[issue45908] dict.fromkeys insertion order

2021-11-27 Thread Vedran Čačić
Vedran Čačić added the comment: Absolutely, but that's not my problem. I take your sentence to mean that when I do something with a _dict_ argument, it should try to preserve its insertion order as much as possible (given the semantics of the concrete method in question). I agree. But my que

[issue45908] dict.fromkeys insertion order

2021-11-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: All the dict methods retain insertion order. There is nothing special about fromkeys(). -- ___ Python tracker ___ ___

[issue45908] dict.fromkeys insertion order

2021-11-27 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +methane, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue45908] dict.fromkeys insertion order

2021-11-27 Thread Vedran Čačić
New submission from Vedran Čačić : I'm sure this is exactly how it should work, I just want to know if you think it is documented properly, so I can rely on it. In my opinion the docs should be more precise. >>> ''.join(dict.fromkeys('axbxc')) 'axbc' Is this guaranteed by the documentation? O