GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — gh-117764: Add docstrings and signatures for the __replace__ methods by serhiy-storchaka · Pull Request #117768 · python/cpython Conversation
|
| {"__replace__", _PyCFunction_CAST(namespace_replace), METH_VARARGS|METH_KEYWORDS, NULL}, | ||
| {"__replace__", _PyCFunction_CAST(namespace_replace), METH_VARARGS|METH_KEYWORDS, | ||
| PyDoc_STR("__replace__($self, **changes)\n--\n\n" | ||
| "Return a copy of the namespace object with new values for the specified attributes.")}, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why this docstring uses the term attributes, but all the others in this PR use the term fields?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Because SimpleNamespace is described as "a simple attribute-based namespace". code.replace() talk about fields (I copied the docstring for __replace__()). Also, the set of fields is limited for all other objects, you cannot set an arbitrary attribute.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.