-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
gh-150319: Replace all documentation which says "See PEP 585" #150325
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
base: main
Are you sure you want to change the base?
Changes from all commits
12ca4d9
d797621
3a51ab5
3f22858
33770c7
cf6e6b6
7ab7974
26600c5
a02c487
4986ead
680f16c
4bb0cbf
7b3ea53
9bb3854
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -42,6 +42,9 @@ Context Variables | |||||
| references to context variables which prevents context variables | ||||||
| from being properly garbage collected. | ||||||
|
|
||||||
| Context Variables are :ref:`generic <generics>` over the type of | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would be inconsistent with the rest of this module's doc. I wouldn't mind doing a separate PR to change this for the whole page, but I don't want to be responsible for introducing local inconsistency.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a sentence just above saying "references to context variables". I don't think we should have "Context Variables". So I don't think we need to introduce inconsistent changes in new content. You can always make the change afterwards. |
||||||
| their contained value. | ||||||
|
|
||||||
| .. attribute:: ContextVar.name | ||||||
|
|
||||||
| The name of the variable. This is a read-only property. | ||||||
|
|
@@ -130,6 +133,9 @@ Context Variables | |||||
| Tokens support the :ref:`context manager protocol <context-managers>` | ||||||
| to automatically reset context variables. See :meth:`ContextVar.set`. | ||||||
|
|
||||||
| Tokens are :ref:`generic <generics>` over the same type as the | ||||||
| :class:`ContextVar` which created them. | ||||||
|
|
||||||
| .. versionadded:: 3.14 | ||||||
|
|
||||||
| Added support for usage as a context manager. | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1403,6 +1403,8 @@ application). | |||||
| Many other operations also produce lists, including the :func:`sorted` | ||||||
| built-in. | ||||||
|
|
||||||
| Lists are :ref:`generic <generics>` over the types of their items. | ||||||
|
|
||||||
| Lists implement all of the :ref:`common <typesseq-common>` and | ||||||
| :ref:`mutable <typesseq-mutable>` sequence operations. Lists also provide the | ||||||
| following additional method: | ||||||
|
|
@@ -1494,6 +1496,10 @@ homogeneous data is needed (such as allowing storage in a :class:`set` or | |||||
| Tuples implement all of the :ref:`common <typesseq-common>` sequence | ||||||
| operations. | ||||||
|
|
||||||
| Tuples are :ref:`generic <generics>` over the types of their contents. | ||||||
| For more information, refer to | ||||||
| :ref:`the typing documentation on annotating tuples <annotating-tuples>`. | ||||||
|
|
||||||
| For heterogeneous collections of data where access by name is clearer than | ||||||
| access by index, :func:`collections.namedtuple` may be a more appropriate | ||||||
| choice than a simple tuple object. | ||||||
|
|
@@ -4586,6 +4592,9 @@ copying. | |||||
| types such as :class:`bytes` and :class:`bytearray`, an element is a single | ||||||
| byte, but other types such as :class:`array.array` may have bigger elements. | ||||||
|
|
||||||
| :class:`!memoryviews` are :ref:`generic <generics>` over the type of their | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| underlying data. | ||||||
|
|
||||||
| ``len(view)`` is equal to the length of :meth:`~memoryview.tolist`, which | ||||||
| is the nested list representation of the view. If ``view.ndim = 1``, | ||||||
| this is equal to the number of elements in the view. | ||||||
|
|
@@ -5279,6 +5288,8 @@ Note, the *elem* argument to the :meth:`~object.__contains__`, | |||||
| :meth:`~set.discard` methods may be a set. To support searching for an equivalent | ||||||
| frozenset, a temporary one is created from *elem*. | ||||||
|
|
||||||
| Sets and frozensets are :ref:`generic <generics>` over the type of their elements. | ||||||
|
|
||||||
| .. seealso:: | ||||||
|
|
||||||
| For detailed information on thread-safety guarantees for :class:`set` | ||||||
|
|
@@ -5382,6 +5393,9 @@ can be used interchangeably to index the same dictionary entry. | |||||
| Dictionary order is guaranteed to be insertion order. This behavior was | ||||||
| an implementation detail of CPython from 3.6. | ||||||
|
|
||||||
| Dictionaries are :ref:`generic <generics>` over two types, signifying | ||||||
| (respectively) the types of the dictionary's keys and values. | ||||||
|
|
||||||
| These are the operations that dictionaries support (and therefore, custom | ||||||
| mapping types should support too): | ||||||
|
|
||||||
|
|
@@ -5719,6 +5733,9 @@ Frozen dictionaries | |||||
| :class:`!frozendict` is not a :class:`!dict` subclass but inherits directly | ||||||
| from ``object``. | ||||||
|
|
||||||
| Like dictionaries, frozendicts are :ref:`generic <generics>` over two types, | ||||||
| signifying (respectively) the types of the frozendict's keys and values. | ||||||
|
|
||||||
| .. versionadded:: 3.15 | ||||||
|
|
||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -386,6 +386,9 @@ Standard names are defined for the following types: | |||||
| entries, which means that when the mapping changes, the view reflects these | ||||||
| changes. | ||||||
|
|
||||||
| MappingProxyTypes are :ref:`generic <generics>` over two types, signifying (respectively) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| the types of the underlying mapping's keys and values. | ||||||
|
|
||||||
| .. versionadded:: 3.3 | ||||||
|
|
||||||
| .. versionchanged:: 3.9 | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Generic builtin and standard library types now document the meaning of their | ||
| type parameters. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5129,7 +5129,8 @@ static PyMethodDef mapp_methods[] = { | |
| DICT_CLEAR_METHODDEF | ||
| DICT_COPY_METHODDEF | ||
| DICT___REVERSED___METHODDEF | ||
| {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, | ||
| {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, | ||
| PyDoc_STR("dicts are generic over two types, signifying (respectively) the types of their keys and values")}, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The wording for mappingproxy is:
Here the wording is
Can we have unified wordings please for mapping objects, etc?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep! The latter wording was an improvement during review and I meant to apply it everywhere, but missed this one. A couple of greps show it as the only one still on the old wording. Fixing this case should make everything consistent. |
||
| {NULL, NULL} /* sentinel */ | ||
| }; | ||
|
|
||
|
|
@@ -8197,7 +8198,8 @@ static PyMethodDef frozendict_methods[] = { | |
| DICT_FROMKEYS_METHODDEF | ||
| FROZENDICT_COPY_METHODDEF | ||
| DICT___REVERSED___METHODDEF | ||
| {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, | ||
| {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, | ||
| PyDoc_STR("frozendicts are generic over two types, signifying (respectively) the types of the frozendict's keys and values")}, | ||
| {"__getnewargs__", frozendict_getnewargs, METH_NOARGS}, | ||
| {NULL, NULL} /* sentinel */ | ||
| }; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
IIRC, the
\strick is to avoid a space and a lint warning.