This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2013年03月14日 20:33 by eric.snow, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue17422.stoneleaf.01.patch | ethan.furman, 2015年01月15日 05:20 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 18559 | merged | Ananthakrishnan, 2020年02月19日 11:11 | |
| PR 18610 | merged | miss-islington, 2020年02月22日 17:59 | |
| PR 18611 | merged | miss-islington, 2020年02月22日 18:00 | |
| PR 18682 | merged | donovick, 2020年02月28日 01:41 | |
| PR 18812 | merged | miss-islington, 2020年03月06日 18:21 | |
| PR 18813 | merged | miss-islington, 2020年03月06日 18:21 | |
| Messages (13) | |||
|---|---|---|---|
| msg184188 - (view) | Author: Eric Snow (eric.snow) * (Python committer) | Date: 2013年03月14日 20:33 | |
(related to PEP 422 and issue #17044) The execution namespace from a class definition is passed as the third argument to the metaclass (see builtin___build_class__() in Python/bltinmodule.c). When applicable, which is almost always, the subsequent call to type.__new__() copies that namespace into a new dict which is in turn exposed via the class's __dict__. This matters in the case where a metaclass with __prepare__() gets used (or the PEP 422 equivalent). The language reference[1] should note that the object returned by __prepare__() is copied into a new dict when the class is finally created via the metaclass. [1] http://docs.python.org/3.4/reference/datamodel.html#customizing-class-creation |
|||
| msg362272 - (view) | Author: Ananthakrishnan (Ananthakrishnan) * | Date: 2020年02月19日 13:59 | |
I just addded a PR for this issue. |
|||
| msg362470 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2020年02月22日 17:56 | |
New changeset fbe2e0bb8a7ee75d0f9d57682436dac7d69e202e by ananthan-123 in branch 'master': bpo-17422: Language reference should specify restrictions on class namespace (#18559) https://github.com/python/cpython/commit/fbe2e0bb8a7ee75d0f9d57682436dac7d69e202e |
|||
| msg362479 - (view) | Author: miss-islington (miss-islington) | Date: 2020年02月22日 21:16 | |
New changeset 91ba44623e5cb8f4a7b0d3fc1fab8ff8d8a849c2 by Miss Islington (bot) in branch '3.8': bpo-17422: Language reference should specify restrictions on class namespace (GH-18559) https://github.com/python/cpython/commit/91ba44623e5cb8f4a7b0d3fc1fab8ff8d8a849c2 |
|||
| msg362480 - (view) | Author: miss-islington (miss-islington) | Date: 2020年02月22日 21:16 | |
New changeset 36a120d343c1cb69b8d02913569c153e8bb969c8 by Miss Islington (bot) in branch '3.7': bpo-17422: Language reference should specify restrictions on class namespace (GH-18559) https://github.com/python/cpython/commit/36a120d343c1cb69b8d02913569c153e8bb969c8 |
|||
| msg362853 - (view) | Author: Eric Snow (eric.snow) * (Python committer) | Date: 2020年02月28日 00:54 | |
Thanks for working on this. Sorry I didn't get a chance to see your PR sooner. There was one small thing that needs to be changed back, as I implied in my comment on the PR [1]. Please undo the change in the text from "ordered mapping" to "dict". The original "is initialised as an empty ordered mapping" text line should be restored. "dict" is currently still not correct (the language spec does not dictate that dict be ordered). However, PEP 520 specifies that it must be ordered. Thanks! [1] https://github.com/python/cpython/pull/18559#pullrequestreview-366098695 |
|||
| msg362854 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2020年02月28日 00:58 | |
As I mentioned in my response on the PR, dict *is* required to be ordered since 3.7. So I think it is okay as is. |
|||
| msg362856 - (view) | Author: Caleb Donovick (donovick) * | Date: 2020年02月28日 01:08 | |
While It is perfectly fine behavior for CPython to use a dict, as dict is an ordered mapping. I think Eric is right that the data model should not specify that a dict is necessarily used in the absence of __prepare__. |
|||
| msg363530 - (view) | Author: miss-islington (miss-islington) | Date: 2020年03月06日 18:20 | |
New changeset e59334ebc9308b0f3ad048ef293c6b49e6456d1a by Caleb Donovick in branch 'master': bpo-17422: slightly more precise language (GH-18682) https://github.com/python/cpython/commit/e59334ebc9308b0f3ad048ef293c6b49e6456d1a |
|||
| msg363531 - (view) | Author: miss-islington (miss-islington) | Date: 2020年03月06日 18:25 | |
New changeset f1b79645cf18b2c212cd26d547cd1762fd534d4b by Miss Islington (bot) in branch '3.7': bpo-17422: slightly more precise language (GH-18682) https://github.com/python/cpython/commit/f1b79645cf18b2c212cd26d547cd1762fd534d4b |
|||
| msg363532 - (view) | Author: miss-islington (miss-islington) | Date: 2020年03月06日 18:26 | |
New changeset 6df0c47669031c6a8e9b1a07ec2c5813e4c10ee0 by Miss Islington (bot) in branch '3.8': bpo-17422: slightly more precise language (GH-18682) https://github.com/python/cpython/commit/6df0c47669031c6a8e9b1a07ec2c5813e4c10ee0 |
|||
| msg363534 - (view) | Author: Eric Snow (eric.snow) * (Python committer) | Date: 2020年03月06日 18:38 | |
Thanks for fixing that, Caleb! FWIW, I've opened a separate issue (#39879) for adding a note in the language reference about dict ordering. Sorry for the confusion. |
|||
| msg363807 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2020年03月10日 07:48 | |
New changeset 22448149a05b5bc3e3a2ffdc0682bcd01995ce2a by Ned Deily (Miss Islington (bot)) in branch '3.7': bpo-17422: slightly more precise language (GH-18682) https://github.com/python/cpython/commit/22448149a05b5bc3e3a2ffdc0682bcd01995ce2a |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:42 | admin | set | github: 61624 |
| 2020年03月10日 07:48:52 | ned.deily | set | nosy:
+ ned.deily messages: + msg363807 |
| 2020年03月06日 18:38:42 | eric.snow | set | status: open -> closed resolution: fixed messages: + msg363534 stage: patch review -> resolved |
| 2020年03月06日 18:26:56 | miss-islington | set | messages: + msg363532 |
| 2020年03月06日 18:25:54 | miss-islington | set | messages: + msg363531 |
| 2020年03月06日 18:21:21 | miss-islington | set | pull_requests: + pull_request18171 |
| 2020年03月06日 18:21:15 | miss-islington | set | pull_requests: + pull_request18170 |
| 2020年03月06日 18:20:52 | miss-islington | set | messages: + msg363530 |
| 2020年02月28日 01:57:22 | gvanrossum | set | nosy:
- gvanrossum |
| 2020年02月28日 01:41:56 | donovick | set | stage: needs patch -> patch review pull_requests: + pull_request18041 |
| 2020年02月28日 01:08:11 | donovick | set | messages: + msg362856 |
| 2020年02月28日 00:58:09 | gvanrossum | set | messages: + msg362854 |
| 2020年02月28日 00:54:37 | eric.snow | set | status: closed -> open versions: + Python 3.7, Python 3.8, Python 3.9, - Python 3.4, Python 3.5 messages: + msg362853 resolution: fixed -> (no value) stage: resolved -> needs patch |
| 2020年02月22日 21:16:46 | miss-islington | set | messages: + msg362480 |
| 2020年02月22日 21:16:28 | miss-islington | set | nosy:
+ miss-islington messages: + msg362479 |
| 2020年02月22日 18:00:06 | miss-islington | set | pull_requests: + pull_request17976 |
| 2020年02月22日 17:59:58 | miss-islington | set | pull_requests: + pull_request17975 |
| 2020年02月22日 17:58:21 | gvanrossum | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2020年02月22日 17:56:05 | gvanrossum | set | nosy:
+ gvanrossum messages: + msg362470 |
| 2020年02月19日 13:59:02 | Ananthakrishnan | set | nosy:
+ Ananthakrishnan messages: + msg362272 |
| 2020年02月19日 11:11:02 | Ananthakrishnan | set | pull_requests: + pull_request17939 |
| 2020年02月07日 20:06:14 | donovick | set | nosy:
+ donovick |
| 2015年07月21日 07:36:01 | ethan.furman | set | nosy:
- ethan.furman |
| 2015年01月15日 05:20:52 | ethan.furman | set | files:
+ issue17422.stoneleaf.01.patch keywords: + patch stage: needs patch -> patch review versions: + Python 3.5 |
| 2014年05月19日 01:34:10 | ethan.furman | set | nosy:
+ ethan.furman |
| 2013年03月16日 12:56:01 | ncoghlan | link | issue17421 dependencies |
| 2013年03月14日 21:56:42 | daniel.urban | set | nosy:
+ daniel.urban |
| 2013年03月14日 20:33:35 | eric.snow | create | |