| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks @ananthan-123. No need to request reviews from 3 triagers and 4 core developers though, that's bordering on spam (especially if they have nothing to do with the issue/patch). One request should be fine, maybe a second if the first person doesn't respond after a week or two.
A few things I spotted here (I'm assuming that the wording in Eric's original patch from 7 years ago is correct):
Sorry, something went wrong.
Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
…7_9zz.rst Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
There was a problem hiding this comment.
Looks good now. @ericsnowcurrently, care to review the content for this? It's your issue.
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, one more thing...
Sorry, something went wrong.
…7_9zz.rst Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
| @@ -0,0 +1 @@ | |||
| Language reference should specify restrictions on class namespace. | |||
There was a problem hiding this comment.
Please attribute the patch to its author here.
Sorry, something went wrong.
|
@gvanrossum: Please replace # with GH- in the commit message next time. Thanks! |
Sorry, something went wrong.
|
Thanks @ananthan-123 for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Sorry, something went wrong.
|
Thanks @ananthan-123 for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry, something went wrong.
|
GH-18610 is a backport of this pull request to the 3.8 branch. |
Sorry, something went wrong.
…mespace (pythonGH-18559) The language reference now specifies restrictions on class namespaces. Adapted from a patch by Ethan Furman. (cherry picked from commit fbe2e0b) Co-authored-by: ananthan-123 <ananthakrishnan15.2001@gmail.com>
|
GH-18611 is a backport of this pull request to the 3.7 branch. |
Sorry, something went wrong.
| the final class object is created the namespace is copied into a new ``dict``. | ||
|
|
||
| If the metaclass has no ``__prepare__`` attribute, then the class namespace | ||
| is initialised as an empty ordered mapping. |
There was a problem hiding this comment.
Per PEP 520, the default class namespace must be an ordered mapping and the original text here was purposefully phrased. While we've talked about requiring "dict" to be ordered (in the language reference), that hasn't happened. So changing the language spec text here to "dict" is inappropriate without a PEP. Note that elsewhere in the language reference the "ordered mapping" phrasing still exists.
Sorry, something went wrong.
There was a problem hiding this comment.
Um, dict is required to be ordered. Since 3.7. See the 3.7. what's new doc "the insertion-order preservation nature of dict objects has been declared to be an official part of the Python language spec."
If after that has sunk in you still think this PR is wrong, please submit a new PR to fix it! (Sorry for landing prematurely.)
Sorry, something went wrong.
There was a problem hiding this comment.
Per my comment on the bpo I think @ericsnowcurrently is right but for the wrong reasons. I have opened a PR correcting the wording. #18682
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
https://bugs.python.org/issue17422