| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you!
is #101100 the correct issue to reference?
Yep :)
With these changes, nitpicky mode in Sphinx seems happy with csv.rst.
And the CI has failed... But in a good way! It says:
Congratulations! You improved: Doc/library/csv.rst Please remove from Doc/tools/.nitignore
Doing this means the CI will also prevent new warnings from appearing in this file.
Sorry, something went wrong.
| -------------- | ||
|
|
||
| :class:`Writer` objects (:class:`DictWriter` instances and objects returned by | ||
| :class:`Writer<writer>` objects (:class:`DictWriter` instances and objects returned by |
There was a problem hiding this comment.
We usually add a space here:
| :class:`Writer<writer>` objects (:class:`DictWriter` instances and objects returned by | |
| :class:`Writer <writer>` objects (:class:`DictWriter` instances and objects returned by |
Although, I don't see a Writer class with capital W, is it only capitalised because it begins the sentence? If so, I'd either reword so it's not first, or leave it lowercase.
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, I left it capitalized. I suspect the original author may have done it that way. I just added a proper reference. The csv module dates from the days when types (written in C) and classes (written in Python) were not quite the same thing. Type names generally weren't capitalized (I think, hence csv.writer), while classes were, hence csv.DictWriter.
Sorry, something went wrong.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
|
@hugovk I think I made all the suggested changes... |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good, thanks!
Just want to double check the write.
Sorry, something went wrong.
| Return a writer object responsible for converting the user's data into delimited | ||
| strings on the given file-like object. *csvfile* can be any object with a | ||
| :func:`write` method. If *csvfile* is a file object, it should be opened with | ||
| :meth:`~io.TextIOBase.write` method. If *csvfile* is a file object, it should be opened with |
There was a problem hiding this comment.
@serhiy-storchaka Is this the correct one for write in this case?
Sorry, something went wrong.
There was a problem hiding this comment.
I guess it is.
Sorry, something went wrong.
There was a problem hiding this comment.
Good question. I mulled that over a bit before using TextIOBase, eventually deciding that since CSV files are supposed to be opened as plain text files since Python 3, that was the most reasonable link destination.
Sorry, something went wrong.
There was a problem hiding this comment.
You can also explicitly mention that write() should accept a string argument (not bytes). And the same for the reader.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
Perhaps we can rename csvwriter to writer, but it is a separate issue, and it may have pitfalls.
Sorry, something went wrong.
| Return a writer object responsible for converting the user's data into delimited | ||
| strings on the given file-like object. *csvfile* can be any object with a | ||
| :func:`write` method. If *csvfile* is a file object, it should be opened with | ||
| :meth:`~io.TextIOBase.write` method. If *csvfile* is a file object, it should be opened with |
There was a problem hiding this comment.
I guess it is.
Sorry, something went wrong.
Since there is no type called csvwriter, what pitfalls would correcting those references be? |
Sorry, something went wrong.
|
csv.writer is not a class, csv.writer() returns an instance of _csv.Writer class which is not exposed itself. writerow() is defined as a method of a fictional class csvwriter, but actually it is a description of writerow() in unrelated classes _csv.Writer and csv.DictWriter. csv.DictWriter is not a subclass of _csv.Writer or csv.writer (which is not even a class). All so complicated, that I cannot predict what Sphinx will produce. We have to try and see at the result. All can just work, or produce glitches from which we could not know how to get rid. |
Sorry, something went wrong.
|
In the spirit of incremental changes, shall we merge this as-is (it does what it set out to do: fix reference warnings), and make a new PR for any further changes? |
Sorry, something went wrong.
|
Thanks @smontanaro for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, something went wrong.
|
Sorry, @smontanaro and @serhiy-storchaka, I could not cleanly backport this to 3.12 due to a conflict. cherry_picker 3911b42cc0d404e0eac87fce30b740b08618ff06 3.12 |
Sorry, something went wrong.
|
Sorry, @smontanaro and @serhiy-storchaka, I could not cleanly backport this to 3.11 due to a conflict. cherry_picker 3911b42cc0d404e0eac87fce30b740b08618ff06 3.11 |
Sorry, something went wrong.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> (cherry picked from commit 3911b42)
|
@serhiy-storchaka @hugovk I attempted to create the two pull requests. Please take a look and let me know if I missed something or resolved the .nitignore conflict incorrectly (quite possible). |
Sorry, something went wrong.
|
Not sure what you're referring to. I was just executing the cherry-picker commands the bedevere not have. Did I mess something up? |
Sorry, something went wrong.
|
I don't know if it was you or cherry_picker, but the PRs were based on main rather than their respective 3.12 or 3.11 branch. The PR branches themselves were fine, though. That is, the error was in the creation of the PRs, not the creation of the backports. |
Sorry, something went wrong.
|
That's weird. I did run the commands from my 3.12 and 3.11 repos. |
Sorry, something went wrong.
|
GH-114771 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
|
GH-114773 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
This is my first attempt at this. Hopefully I've done it correctly. I would appreciate checks on my changes and the mechanics (is gh-101100 the correct issue to reference?). Thanks to @hugovk for helping me get started. There are two types of changes herein:
With these changes, nitpicky mode in Sphinx seems happy with csv.rst.
📚 Documentation preview 📚: https://cpython-previews--114658.org.readthedocs.build/