-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Docs: align usage of versionadded with recommended practice #114409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: align usage of versionadded with recommended practice #114409
Conversation
@CAM-Gerlach, let me know if you want me to split this up. |
For some background, a while ago I leaned in favor of Comparing current usage on (To note though @erlend-aasland this PR appears to only catch those that contain Full results for `versionadded` with params/args in body
This also follows the established guidance in the devguide:
Footnotes
|
As to this PR, while it's broad-reach certainly isn't ideal and it would be nice to find a better way to split it up along logical boundaries, pragmatically speaking its probably a good deal less noisy than, lots of e.g. individual PRs for every module to change a few lines. Perhaps the best we can do is split up mentions of parameters with those of anything else, and perhaps even "parameters" and "arguments" (although the distinction is more or less just spelling). But maybe best to keep as one atomic PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To note, this mostly appears to address instances where param(eter)?
(and perhaps "attribute") was mentioned in a versionadded
, but not arg(ument)?
, which a roughly equal number of instances use to refer to the same thing.
Full results for `versionadded` with params/args in body
versionadded::.*(\n){0,1}.*([Pp]aram|[Aa]rg)" (76 hits in 30 files of 465 searched)
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\c-api\code.rst (1 hit)
Line 66: .. versionadded:: 3.8 as ``PyCode_NewWithPosOnlyArgs``
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\argparse.rst (1 hit)
Line 1939: .. versionadded:: 3.4
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\asyncio-stream.rst (1 hit)
Line 80: .. versionadded:: 3.8
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\bdb.rst (1 hit)
Line 135: .. versionadded:: 3.1
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\concurrent.futures.rst (1 hit)
Line 174: .. versionadded:: 3.6
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\configparser.rst (4 hits)
Line 1048: .. versionadded:: 3.2
Line 1052: .. versionadded:: 3.6.1
Line 1055: .. versionadded:: 3.7
Line 1294: .. versionadded:: 3.2
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\datetime.rst (5 hits)
Line 862: .. versionadded:: 3.6
Line 1261: .. versionadded:: 3.6
Line 1505: .. versionadded:: 3.6
Line 1840: .. versionadded:: 3.6
Line 1884: .. versionadded:: 3.6
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\difflib.rst (2 hits)
Line 55: .. versionadded:: 3.2
Line 386: .. versionadded:: 3.2
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\email.policy.rst (1 hit)
Line 221: .. versionadded:: 3.5
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\functions.rst (2 hits)
Line 1076: .. versionadded:: 3.4
Line 1114: .. versionadded:: 3.4
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\functools.rst (1 hit)
Line 278: .. versionadded:: 3.9
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\http.client.rst (1 hit)
Line 464: .. versionadded:: 3.6
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\http.server.rst (5 hits)
Line 331: .. versionadded:: 3.7
Line 441: .. versionadded:: 3.4
Line 444: .. versionadded:: 3.8
Line 453: .. versionadded:: 3.7
Line 462: .. versionadded:: 3.11
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\logging.config.rst (1 hit)
Line 130: .. versionadded:: 3.10
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\logging.handlers.rst (1 hit)
Line 874: .. versionadded:: 3.3
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\logging.rst (3 hits)
Line 618: .. versionadded:: 3.2
Line 621: .. versionadded:: 3.8
Line 624: .. versionadded:: 3.10
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\multiprocessing.shared_memory.rst (1 hit)
Line 91: .. versionadded:: 3.13
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\os.rst (14 hits)
Line 1254: .. versionadded:: 3.3
Line 2023: .. versionadded:: 3.3
Line 2199: .. versionadded:: 3.3
Line 2364: .. versionadded:: 3.3
Line 2398: .. versionadded:: 3.2
Line 2432: .. versionadded:: 3.3
Line 2454: .. versionadded:: 3.3
Line 2535: .. versionadded:: 3.3
Line 2566: .. versionadded:: 3.3
Line 2617: .. versionadded:: 3.3
Line 2673: .. versionadded:: 3.3
Line 2962: .. versionadded:: 3.3
Line 3383: .. versionadded:: 3.3
Line 3432: .. versionadded:: 3.3
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\pdb.rst (2 hits)
Line 212: .. versionadded:: 3.1
Line 215: .. versionadded:: 3.2
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\pickletools.rst (1 hit)
Line 97: .. versionadded:: 3.2
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\shutil.rst (1 hit)
Line 292: .. versionadded:: 3.8
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\sqlite3.rst (4 hits)
Line 346: .. versionadded:: 3.4
Line 355: .. versionadded:: 3.12
Line 750: .. versionadded:: 3.8
Line 1135: .. versionadded:: 3.12
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\subprocess.rst (5 hits)
Line 311: .. versionadded:: 3.6
Line 314: .. versionadded:: 3.7
Line 687: .. versionadded:: 3.10
Line 1541: .. versionadded:: 3.11
Line 1559: .. versionadded:: 3.11
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\unittest.rst (1 hit)
Line 2199: .. versionadded:: 3.12
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\urllib.parse.rst (1 hit)
Line 732: .. versionadded:: 3.5
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\venv.rst (3 hits)
Line 204: .. versionadded:: 3.6
Line 207: .. versionadded:: 3.9
Line 210: .. versionadded:: 3.13
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\xml.etree.elementtree.rst (6 hits)
Line 708: .. versionadded:: 3.4
Line 711: .. versionadded:: 3.8
Line 735: .. versionadded:: 3.4
Line 738: .. versionadded:: 3.8
Line 861: .. versionadded:: 3.9
Line 1192: .. versionadded:: 3.4
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\xml.sax.utils.rst (1 hit)
Line 74: .. versionadded:: 3.2
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\zipapp.rst (1 hit)
Line 174: .. versionadded:: 3.7
C:\Users\C. A. M. Gerlach\Documents\dev\Python\cpython\Doc\library\zipfile.rst (4 hits)
Line 244: .. versionadded:: 3.8
Line 651: .. versionadded:: 3.2
Line 707: .. versionadded:: 3.4
Line 752: .. versionadded:: 3.8
.. versionadded:: 3.9 | ||
Added the function :func:`cache_parameters` | ||
.. versionchanged:: 3.9 | ||
Added the function :func:`!cache_parameters` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds to me based on this writing that this function was added to the module (which, as far as I can tell, it wasn't), as opposed to being an additional behavior in cmp_to_key
. Assuming the latter is in fact the case, and since its non-trivial to find more information about it (not being crosslinked), I'd rewrite this as something like:
Added the function :func:`!cache_parameters` | |
Instrument the wrapped callable with a :func:`!cache_parameters` function | |
to retrieve the *maxsize* and *typed* of its cache. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but I deliberately did not change it. It may be beneficial to address this in a separate PR.
Yes, I grepped for instances of
For this type of change, I think it is best to do it all in one atomic PR; IMO, it is not worth the CI churn to split it up. We can land this pretty quick. |
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: C.A.M. Gerlach <[email protected]>
Thanks for your thorough reviews, CAM and Ezio! 🙏 |
Mmm, as I feared... |
Yeah, I went for that! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, thanks @erlend-aasland !
How come all the tests are kicking off, instead of just the docs-relevant ones? It only contains changes to |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Unsurprisingly, the backport failed due to conflicts on params, etc. added in 3.13...maybe I should have suggested pulling those out to a separate one, oops. Like a hand with the backport, or you got it already? |
I can do the backports tomorrow (it's getting late over here). Feel free to take care of them, if you feel the urge. |
GH-114472 is a backport of this pull request to the 3.12 branch. |
…ded practice (python#114409) (cherry picked from commit 1d7bddd) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Ezio Melotti <[email protected]>
GH-114473 is a backport of this pull request to the 3.11 branch. |
@CAM-Gerlach, I did the backports. I got the feeling we might have missed some occurrences in os.rst. |
…ded practice (#114409) (#114473) (cherry picked from commit 1d7bddd) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Ezio Melotti <[email protected]>
…ded practice (#114409) (#114472) (cherry picked from commit 1d7bddd) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Ezio Melotti <[email protected]>
…ctice (python#114409) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Ezio Melotti <[email protected]>
…ctice (python#114409) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Ezio Melotti <[email protected]>
📚 Documentation preview 📚: https://cpython-previews--114409.org.readthedocs.build/