-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
gh-105373: Doc lists pending removals #106540
Conversation
875060e
to
aa6735b
Compare
aa6735b
to
a9316b0
Compare
@hugovk, @CAM-Gerlach: Would you mind to review my documentation of this long list of deprecated features? I'm not sure if all of them must be listed under "Pending Removal", since some of them are "incompatible changes" rather than "removals". But it seems like we have this habit in the previous What's New documents as well. So I continued the trend. The phrasing is... minimal. Basically, I copied/pasted error messages from the code which emits DeprecationWarning. Example:
Maybe this entry should be elaborated... a little bit. Or removed. I'm not sure. I had troubles with Sphinx syntax:
This fails with:
I get a
I don't want to get a reference to this function... since it's not documented. And it should not be documented, since it's deprecated. I also added "Pending Removals" under the C API Changes section in a previous commit. |
I merged my PR to continue the work on the issue #105373. But please, don't hesitate to propose a PR to enhance this documentation, or leave post-merge comments on this PR. |
* :mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, | ||
now causes a :exc:`DeprecationWarning` to be emitted when it is used. | ||
|
||
* :class:`!urllib.parse.Quoter`. |
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.
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 created PR #106675 to elaborate this entry.
Pending Removal in Python 3.14 | ||
------------------------------ | ||
|
||
* :mod:`argparse`: The *type*, *choices*, and *metavar* 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.
I like the practice of putting the module name at the start, and listing them alphabetically, makes it easier to find something.
Let's also alphabetise the main "Deprecated" section. (We could add a hidden comment at the top of the sections saying to add new ones alphabetically - see top of whole file for a hidden .. Rules for maintenance:
comment).
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.
Please go ahead if you want to make a similar change in other sections :-)
* :class:`typing.NamedTuple`: | ||
|
||
* The undocumented keyword argument syntax for creating NamedTuple classes | ||
(``NT = NamedTuple("NT", x=int)``) is deprecated, and will be disallowed in | ||
3.15. Use the class-based syntax or the functional syntax instead. | ||
|
||
* When using the functional syntax to create a NamedTuple class, failing to | ||
pass a value to the 'fields' parameter (``NT = NamedTuple("NT")``) is | ||
deprecated. Passing ``None`` to the 'fields' parameter | ||
(``NT = NamedTuple("NT", None)``) is also deprecated. Both will be | ||
disallowed in Python 3.15. To create a NamedTuple class with 0 fields, use | ||
``class NT(NamedTuple): pass`` or ``NT = NamedTuple("NT", [])``. | ||
|
||
* :class:`typing.TypedDict`: When using the functional syntax to create a | ||
TypedDict class, failing to pass a value to the 'fields' parameter (``TD = | ||
TypedDict("TD")``) is deprecated. Passing ``None`` to the 'fields' parameter | ||
(``TD = TypedDict("TD", None)``) is also deprecated. Both will be disallowed | ||
in Python 3.15. To create a TypedDict class with 0 fields, use ``class | ||
TD(TypedDict): pass`` or ``TD = TypedDict("TD", {})``. |
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.
Hmm, these two are listed in the main "Deprecated" section.
Should they be in both or just one?
Looking at older What's New pages, some (but not all) sections have intro texts saying they're were only for deprecations from earlier versions:
- What’s New In Python 3.11
- Deprecated
- "This section lists Python APIs that have been deprecated in Python 3.11."
- Pending Removal in Python 3.12
- "The following Python APIs have been deprecated in earlier Python releases, and will be removed in Python 3.12."
- Deprecated
- What’s New In Python 3.12
- Deprecated
- [no intro text]
- Pending Removal in Python 3.13
- "The following modules and APIs have been deprecated in earlier Python releases, and will be removed in Python 3.13."
- Pending Removal in Python 3.14
- [no intro text]
- Pending Removal in Future Versions
- "The following APIs were deprecated in earlier Python versions and will be removed, although there is currently no date scheduled for their removal."
- Deprecated
re:
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 put the two items in both sections on purpose. We can just copy/paste the Pending Removal section in the future What's New In Python 3.14, and people reading Pending Removal don't have to read the Deprecation section.
Follow-up: PR #106675. |
📚 Documentation preview 📚: https://cpython-previews--106540.org.readthedocs.build/