[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-05 Thread STINNER Victor
STINNER Victor added the comment: While the use case makes sense, test if an application relies on the dictionary iterating order, I'm not sure that adding an option to change the order. For me, it's a rare and very specific use case, whereas your option is public and "too easy" to find and us

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-05 Thread lamby
lamby added the comment: > order of other dicts are implementation detail. Right, exactly :) -- ___ Python tracker ___ ___ Python-bug

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-04 Thread INADA Naoki
INADA Naoki added the comment: see https://mail.python.org/pipermail/python-dev/2016-September/146348.html kwargs, __duct__, and namespace passed to metaclass are ordered by language design. order of other dicts are implementation detail. -- ___ Pyt

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-04 Thread lamby
lamby added the comment: > ordering of namespace dict and kwargs dict are language spec for 3.6 Are they really _specced_ for 3.6? I was under the impression that it was just an implementation detail. -- ___ Python tracker

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-04 Thread INADA Naoki
INADA Naoki added the comment: At least, ordering of namespace dict and kwargs dict are language spec for 3.6. This option breaks it. When this option is set, CPython 3.6 is not Python 3.6. -- ___ Python tracker _

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-04 Thread lamby
lamby added the comment: > we're expecting we'll make that a language requirement Mmm, but only for (at least) 3.7+. It would still be very useful to find software that is relying on (currently) undefined behaviour, no? -- ___ Python tracker

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread R. David Murray
R. David Murray added the comment: But that reliance/reproducibility-error would be an issue only on interpreters that don't preserve insertion order, and we're expecting we'll make that a language requirement. So for now, or for as long as you think it is warranted, just test against interpr

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread lamby
lamby added the comment: I think we are misunderstanding each other regarding our goals here :) I'm not trying to test against other Python implementations or versions of CPython itself but rather "flush out" reproducibility issues in third-party Python code that (incorrectly) relies on dict o

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with David and Inada on this one (it is likely to become a wasted effort and it impacts maintainability to try to support this even for the short run). -- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread R. David Murray
R. David Murray added the comment: Inada: we haven't 100% decided that this is going to become a language feature. However it is likely to become so, so adding such a flag is probably wasted effort. Further, if the goal is to test compatibility with other python implementations, shouldn't yo

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread INADA Naoki
INADA Naoki added the comment: For checking compatibility with other implementation, I want to wait until other implementation compatible with 3.6+ which doesn't keep insertion order of dict. For now, there are no 3.6+ compatible Python implementation except CPython. For checking compatibility w

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread lamby
lamby added the comment: > If the package produce same binary when dict keeps insertion order, > isn't it a "reproducible build"? No, as that's a CPython-specific (and 3.6+) implementation detail. Hence "forcing" a test for it :) -- ___ Python track

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread INADA Naoki
INADA Naoki added the comment: I can't understand what is the problem. If the package produce same binary when dict keeps insertion order, isn't it a "reproducible build"? -- ___ Python tracker

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread lamby
lamby added the comment: > Why don't you use OrderdDict and reversed()? This isn't for my own code; I want to change the behaviour of CPython itself so it affects arbitrary third-party code - this is what we are testing when we are testing for reproducibility :) -- __

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread INADA Naoki
INADA Naoki added the comment: Why don't you use OrderdDict and reversed()? -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bu

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-03 Thread lamby
New submission from lamby: Due to implementation changes, since CPython 3.6 dict keys are returned in insertion order. However, in order to test for reproducible builds [0], it would be convenient to be able to reverse this ordering; we would then run a build of an arbitrary package both with and