| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
I have not worked on docstrings, especially not for anything other that IDLE, for years. The best reference I know is the Multiline String section of https://peps.python.org/pep-0257/, though the thoroughness described there may be rare. Still, these need more work. The xml.dom and xml.dom.minidom docs should be a basis for corresponding docstrings. Usefully summarizing behavior can be hard.
I think a blurb should be added, but this can wait.
Sorry, something went wrong.
| """ | ||
| Clone a node and give it the new owner document. | ||
| Returns a copy of node. |
There was a problem hiding this comment.
Remove \n after """. Add after this line. But this revision seems wrong as it omits mention of newOwnerDocument. I would have to read code to suggest improvement.
Sorry, something went wrong.
| self.childNodes[:] = L | ||
|
|
||
| def cloneNode(self, deep): | ||
| """The Node.cloneNode() method returns a duplicate of the node.""" |
There was a problem hiding this comment.
Should be "Return a duplicate ...", but needs to explain 'deep' (I suspect it is a boolean.) Docstrings are for quick reminders when coding, and 'deep' is not obvious.
Sorry, something went wrong.
| return self.internalSubset | ||
|
|
||
| def cloneNode(self, deep): | ||
| """The Node.cloneNode() method returns a duplicate of the node.""" |
There was a problem hiding this comment.
See other cloneNode comment.
Sorry, something went wrong.
| return node | ||
|
|
||
| def replaceChild(self, newChild, oldChild): | ||
| """Replace an existing node with a new node.""" |
There was a problem hiding this comment.
| """Replace an existing node with a new node.""" | |
| """Replace child node *oldChild* with *newChild*.""" |
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request. |
Sorry, something went wrong.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…o()` (python#128337) These methods combine `_delete()` and `copy()`, but `_delete()` isn't part of the public interface, and it's unlikely to be added until the pathlib ABCs are made official, or perhaps even later.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…er test (python#128338) In the tests for `pathlib.Path.walk()`, avoid using the path class under test (`self.cls`) in test setup. Instead we use `os` functions in `test_pathlib`, and direct manipulation of `DummyPath` internal data in `test_pathlib_abc`.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
pythongh-128455) Add `BOLT_COMMON_FLAGS` with `-update-debug-sections` Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
…he atomic operation (pythongh-128196)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
||
|
|
||
| class Node(xml.dom.Node): | ||
| """Define properties accessible on a DOM node.""" |
There was a problem hiding this comment.
I think it’s strange to have a class docstring start with a verb; it makes sense for a method (that does something), but a class usually represents a thing (noun), it does not do something.
Sorry, something went wrong.
There was a problem hiding this comment.
Addressed in b97d812
Sorry, something went wrong.
| https://dom.spec.whatwg.org/#dom-node-insertbefore | ||
| The insertBefore(node, child) method, when invoked, | ||
| must return the result of pre-inserting node into | ||
| this before child. |
There was a problem hiding this comment.
I think the docstring should document what the method does, not quote parts of a spec.
I would suggest simpler wording, but I don’t understand the existing one («the result of pre-inserting node into this before child» ?!)
Sorry, something went wrong.
There was a problem hiding this comment.
Addressed in b97d812
Sorry, something went wrong.
| The insertBefore(node, child) method, when invoked, | ||
| must return the result of pre-inserting node into | ||
| this before child. | ||
| See also https://dom.spec.whatwg.org/#concept-node-pre-insert |
There was a problem hiding this comment.
I would have links like this in the reST docs, not docstrings.
Sorry, something went wrong.
There was a problem hiding this comment.
Addressed in b97d812
Sorry, something went wrong.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
|
The formatting concerns from the earlier reviews look addressed. Some remarks on the content:
Also, this only adds a docstring for the Node class; Document, Element, Attr and others still have none, which is what gh-57952 was left open for. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Initial version extracted from PR #24152, which also deleted and modified minidom tests.
Co-authored-by: Karl Dubost karl+github@la-grange.net