gh-114123: migrate docstring from _csv to csv#114124
Conversation
|
I don't think this requires a News entry. In theory, the |
|
Not sure who the default documentation reviewer is. I suspect @encukou will know... |
AA-Turner
left a comment
There was a problem hiding this comment.
This seems fine but I'm not a csv expert!
A
|
Thoughts on backports? I'm somewhat tempted, as future changes to the CSV docstring will be much harder if this PR isn't backported. A |
|
Thoughts on backports? I'm somewhat tempted, as future changes to the CSV
docstring will be much harder if this PR isn't backported.
I don't really have an opinion on the topic. If it simplifies future edits
(are doc changes common in older versions?) I guess it's fine.
That said, I also have no idea what's involved to backport the change.
… |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
I think that this change needs a NEWS entry, because it has a user visible effect in public module (for example removing "__doc__" from __all__).
And while we are here, why not remove also "__version__" from __all__?
|
@serhiy-storchaka Thanks, I'll take care of both later today. |
|
@serhiy-storchaka, some code may rely on |
|
I didn't see @erlend-aasland's note about creeping Removing |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM, besides niypicks about a NEWS file.
| def test__all__(self): | ||
| extra = {'__doc__', '__version__'} | ||
| support.check__all__(self, csv, ('csv', '_csv'), extra=extra) | ||
|
|
There was a problem hiding this comment.
I think test__all__ should be kept?
| def test__all__(self): | |
| extra = {'__doc__', '__version__'} | |
| support.check__all__(self, csv, ('csv', '_csv'), extra=extra) | |
| def test__all__(self): | |
| support.check__all__(self, csv, {'csv', '_csv'}) |
There was a problem hiding this comment.
@AA-Turner Isn't test__all__ a standard thing? Why is this override needed if we no longer have an extra?
There was a problem hiding this comment.
test.support.check__all__() is, but test__all__ isn't defined in unittest.TestCase, so we do need to define the test to keep it.
There was a problem hiding this comment.
No, it is not overridden, it is added. It compares the __all__ content with the calculated expected value (all public function, classes, etc defined in the specified modules). extra is an extra.
|
Before anybody merges (not my job), let's settle on the fate of |
|
No objection to removing _deprecated___version__ = "1.0"
def __getattr__(name):
if name == "__version__":
from warnings import _deprecated
_deprecated(name, remove=(3, 15))
return globals()[f"_deprecated_{name}"]
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")A |
|
The fate of |
Is this the standard idiom for deprecating names? |
That pattern (and variations over it) is used several places in |
| csv.py - read/write/investigate CSV files | ||
|
|
||
| This module provides classes that assist in the reading and writing | ||
| of Comma Separated Value (CSV) files, and implements the interface |
There was a problem hiding this comment.
| of Comma Separated Value (CSV) files, and implements the interface | |
| of comma-separated values files, and implements the interface |
|
Is this the standard idiom for deprecating names?
That pattern (and variations over it) is used several places in Lib/, so
I guess you can call it a standard idiom.
Any possibility of standardizing it enough to stash it somewhere in the std
lib? (Just thinking out loud. After a few times, it seems like it would be
useful to make it into a battery.)
… |
|
I am not sure that there’s enough demand for it, nor a natural place. |
Co-authored-by: Éric <merwok@netwok.org>
|
Thanks @smontanaro for the PR, and @AA-Turner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
|
Sorry, @smontanaro and @AA-Turner, I could not cleanly backport this to |
|
Sorry, @smontanaro and @AA-Turner, I could not cleanly backport this to |
|
I don't think this change should be backported. How did the attempt happen? |
|
I added the backport labels after my note above:
Though given the backport would require manual work regardless, I agree on leaving it for now & not backporting. A |
|
Hmmm... Okay, go for it. Let the chips fall where they may. |
|
Even if this is all about internal location of attributes, it feels safer to not backport. |
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Éric <merwok@netwok.org>
Uh oh!
There was an error while loading. Please reload this page.