[issue24254] Make class definition namespace ordered by default

2017-05-17 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing

[issue24254] Make class definition namespace ordered by default

2016-12-06 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for the ping Ned. Closing this again, as Guido explained the rationale for the change in the python-dev thread referenced above: https://mail.python.org/pipermail/python-dev/2016-September/146371.html -- resolution: -> fixed stage: commit

[issue24254] Make class definition namespace ordered by default

2016-12-06 Thread Ned Deily
Ned Deily added the comment: What's the status of this issue? It's still marked as a "deferred blocker" for 3.6. -- nosy: +ned.deily ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-09-10 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___

[issue24254] Make class definition namespace ordered by default

2016-09-10 Thread Brett Cannon
Brett Cannon added the comment: All reasonable points. You just sounded upset and I wanted to point out the decision was not made lightly, without discussion with the person in charge of the proposal and the BDFL, or we were breaking backwards-compatibility due to some drunken ordered

[issue24254] Make class definition namespace ordered by default

2016-09-10 Thread Nick Coghlan
Nick Coghlan added the comment: While I hadn't read the related thread at the point where I made that comment (so thank you for at least raising the question there), I'm still on the opposite side of the planet, so any decision made in less than 24 hours from proposal to resolution is

[issue24254] Make class definition namespace ordered by default

2016-09-10 Thread Brett Cannon
Brett Cannon added the comment: Do realize that the PEP author was there and made the decision along with Guido to not move forward with a new feature that has not seen the light of day in a stable release, so I don't think blaming the sprinting environment is entirely fair in this case.

[issue24254] Make class definition namespace ordered by default

2016-09-10 Thread Nick Coghlan
Nick Coghlan added the comment: I don't think this is necessarily a blocker for beta 1 (since it can be treated as a bug fix for beta 2 if it's decided to restore the originally proposed behaviour), but it should definitely be resolved before beta 2. -- priority: -> deferred blocker

[issue24254] Make class definition namespace ordered by default

2016-09-10 Thread Nick Coghlan
Nick Coghlan added the comment: Reopening until the __definition_order__ question has been resolved. -- resolution: fixed -> stage: resolved -> commit review status: closed -> open ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-09-10 Thread Nick Coghlan
Nick Coghlan added the comment: Ethan started a python-dev thread here: https://mail.python.org/pipermail/python-dev/2016-September/146358.html -- ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-09-10 Thread Nick Coghlan
Nick Coghlan added the comment: The danger of sprints, and decisions being made without adequate input from affected parties. -- ___ Python tracker ___

[issue24254] Make class definition namespace ordered by default

2016-09-10 Thread STINNER Victor
STINNER Victor added the comment: You should reopen the discussion on python-dev, since the PEP 520 has been accepted with: "Note: Since compact dict has landed in 3.6, __definition_order__ has been removed. cls.__dict__ now mostly accomplishes the same thing instead." The PEP status is now

[issue24254] Make class definition namespace ordered by default

2016-09-10 Thread Ethan Furman
Ethan Furman added the comment: Not having a __definition_order__ could be a disadvantage for classes making use of __getattr__ for virtual attributes, such as Enum and proxy classes. With __definition_order__, and __dir__, Enum could present a coherent view; without it it's a big jumbled

[issue24254] Make class definition namespace ordered by default

2016-09-09 Thread Brett Cannon
Brett Cannon added the comment: Nope, PEP 520 has been updated to drop __definition_order__ and instead state that cls.__dict__ is an ordered mapping. -- ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-09-09 Thread Ethan Furman
Ethan Furman added the comment: Is this going to be added back? Should I add __definition_order__ to Enum? -- ___ Python tracker ___

[issue24254] Make class definition namespace ordered by default

2016-09-08 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___

[issue24254] Make class definition namespace ordered by default

2016-09-08 Thread Eric Snow
Changes by Eric Snow : -- Removed message: http://bugs.python.org/msg275185 ___ Python tracker ___

[issue24254] Make class definition namespace ordered by default

2016-09-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9aa5424fd1df by Eric Snow in branch 'default': Issue #24254: Drop cls.__definition_order__. https://hg.python.org/cpython/rev/9aa5424fd1df -- ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-09-08 Thread Eric Snow
Eric Snow added the comment: Note that most of the changes here have been reverted in changeset 103366:a964b8d2324e9f22a66e458ea72e6d5c8c1fcc93. -- ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-09-05 Thread Eric Snow
Changes by Eric Snow : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-09-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 635fd3912d4d by Eric Snow in branch 'default': Issue #24254: Preserve class attribute definition order. https://hg.python.org/cpython/rev/635fd3912d4d -- nosy: +python-dev ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-08-29 Thread Nick Coghlan
Nick Coghlan added the comment: Because we're not making ordered-by-default dicts a language specification level requirement, so portable code can't rely on them. However, the PEP at https://www.python.org/dev/peps/pep-0520/ is deliberately worded so that there's no requirement for the class

[issue24254] Make class definition namespace ordered by default

2016-08-29 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +fijall ___ Python tracker ___ ___

[issue24254] Make class definition namespace ordered by default

2016-08-29 Thread STINNER Victor
STINNER Victor added the comment: Brett Cannon added the comment: > Any update on this? b1 is exactly 2 weeks away at this point. Why do we need changes specific to classes, if dictionaries could be ordered by default? Issue #27350: "Compact and ordered dict" by INADA Naoki --

[issue24254] Make class definition namespace ordered by default

2016-08-29 Thread Brett Cannon
Brett Cannon added the comment: Any update on this? b1 is exactly 2 weeks away at this point. -- nosy: +brett.cannon ___ Python tracker ___

[issue24254] Make class definition namespace ordered by default

2016-07-19 Thread Eric Snow
Changes by Eric Snow : -- hgrepos: -310 ___ Python tracker ___ ___

[issue24254] Make class definition namespace ordered by default

2016-07-19 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file43629/deforder-with-tp-slot.diff ___ Python tracker ___

[issue24254] Make class definition namespace ordered by default

2016-07-15 Thread Eric Snow
Eric Snow added the comment: post-review updates -- Added file: http://bugs.python.org/file43739/deforder-with-tp-slot.diff ___ Python tracker ___

[issue24254] Make class definition namespace ordered by default

2016-07-14 Thread Eric Snow
Eric Snow added the comment: FTR: PEP 520 "Preserving Class Attribute Definition Order" (https://www.python.org/dev/peps/pep-0520/) -- ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-07-05 Thread Eric Snow
Eric Snow added the comment: Here's an updated patch that matches the accepted PEP. Most notably I've added a tp_deforder slot. This was necessary because subclasses should not inherit their parent's __definition_order__ and the ability to delete cls.__definition_order__ makes this

[issue24254] Make class definition namespace ordered by default

2016-06-13 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag ___ Python tracker ___ ___

[issue24254] Make class definition namespace ordered by default

2016-06-04 Thread Nick Coghlan
Nick Coghlan added the comment: The patch looks good to me as a reference implementation, but I think it's worth writing up as a short PEP so there's a clear reference from the What's New documentation, and so developers of other implementations have a chance to review and comment on the

[issue24254] Make class definition namespace ordered by default

2016-06-03 Thread Eric Snow
Changes by Eric Snow : Added file: http://bugs.python.org/file43169/deforder.diff ___ Python tracker ___

[issue24254] Make class definition namespace ordered by default

2016-06-03 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file43168/deforder.diff ___ Python tracker ___

[issue24254] Make class definition namespace ordered by default

2016-06-03 Thread Eric Snow
Eric Snow added the comment: Here's the full patch, including the addition of __definition_order__, tests, and docs. -- Added file: http://bugs.python.org/file43168/deforder.diff ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-06-02 Thread Eric Snow
Eric Snow added the comment: Thanks. Yeah, I wanted to keep the patches separate for the sake of code review. I'll fold the changes into a single commit once everything's ready. -- ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-06-02 Thread Nick Coghlan
Nick Coghlan added the comment: Patch review sent. The motivation for the change is relatively weak without __definition_order__, though :) -- ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-05-12 Thread Eric Snow
Eric Snow added the comment: Here's a refresh of the patch that only sets the default definition namespace (and does not introduce __definition_order__). -- Added file: http://bugs.python.org/file42834/just-default-to-odict.diff ___ Python tracker

[issue24254] Make class definition namespace ordered by default

2016-05-12 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file39456/just-default-to-odict.diff ___ Python tracker ___

[issue24254] Make class definition namespace ordered by default

2015-05-25 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: -- priority: release blocker - stage: - patch review versions: +Python 3.6 -Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24254

[issue24254] Make class definition namespace ordered by default

2015-05-25 Thread STINNER Victor
STINNER Victor added the comment: It may be a stretch to get this into 3.5, but the final change should be pretty small. Changing the default type of class dictionaries is a huge change. IMO it should be deferred to Python 3.6. -- nosy: +haypo

[issue24254] Make class definition namespace ordered by default

2015-05-25 Thread Eric Snow
Eric Snow added the comment: I've moved this to 3.6. Small as the patch might be, there just isn't enough urgency to warrant making use of an exception to get it into 3.5. If __definition_order__ were still on the table then I'd probably still push for 3.5. :) --

[issue24254] Make class definition namespace ordered by default

2015-05-25 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: -- priority: normal - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24254 ___

[issue24254] Make class definition namespace ordered by default

2015-05-25 Thread Eric Snow
Eric Snow added the comment: Per discussion on python-dev, I'm tabling the __definition_order__ part to 3.6. I'll open a thread on python-ideas on it later and open a new issue here if I get a positive response. So this issue is just about making OrderedDict the default namespace type for

[issue24254] Make class definition namespace ordered by default

2015-05-25 Thread Nick Coghlan
Nick Coghlan added the comment: This is *not* about changing the default type of class dictionaries (which I agree would be far too large a change to make without a PEP), it's only about changing the ephemeral evaluation namespace used to execute the class body. --

[issue24254] Make class definition namespace ordered by default

2015-05-25 Thread Eric Snow
Eric Snow added the comment: This is not about changing the default type for class dictionaries. It is only for changing the default type used during class definition. Essentially, we are just changing the type of what is returned from `type.__prepare__`. cls.__dict__ will remain a dict.

[issue24254] Make class definition namespace ordered by default

2015-05-25 Thread Eric Snow
Eric Snow added the comment: Thanks for pointing out types.prepare_class. I've updated it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24254 ___

[issue24254] Make class definition namespace ordered by default

2015-05-23 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: -- hgrepos: +310 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24254 ___ ___ Python-bugs-list

[issue24254] Make class definition namespace ordered by default

2015-05-23 Thread Nick Coghlan
Nick Coghlan added the comment: types.prepare_class() also needs to be updated to use OrderedDict() by default. -- dependencies: +Add OrderedDict written in C ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24254

[issue24254] Make class definition namespace ordered by default

2015-05-21 Thread Eric Snow
Eric Snow added the comment: Here's a patch that drops adding __definition_order__. You can get the same effect by adding `__definition_order__ = list(locals())` at the bottom of your class definition. The benefit of having `__definition_order__` is that the information is automatically

[issue24254] Make class definition namespace ordered by default

2015-05-20 Thread Eric Snow
New submission from Eric Snow: Here's a work-in-progress patch that uses OrderedDict as the default class definition namespace (instead of dict). While the actual class namespace is a dict, the definition order is preserved on a new attribute on class objects: __definition_order__. This is