Generic type alias documentation?

My Google-fu skills may be waning. I can't seem to find documentation for the new style generic type aliases. Example: tuple[int, ...] I can find the older-style typing.Tuple documentation. Are the new generic type aliases documented somewhere in the Python docs site?

I also had difficulty finding this section, but the GenericAlias type is documented here: https://docs.python.org/3/library/stdtypes.html#types-genericalias It might be good to link to that section from the Generic one in the typing docs. On Mon, May 30, 2022, 6:04 PM Paul Bryan <pbryan@anode.ca> wrote:

That section doesn't cover the specific generic type alias conventions for each of the types (e.g, tuple[t0, t1] vs. tuple[t, ...], dict[key_t, value_t], etc. Would it make sense to bake these into the docstrings of each of the types for easy reference? On Mon, 2022-05-30 at 19:59 -0700, Ethan Smith wrote:

There was a similar thread about this here, https://mail.python.org/archives/list/python-dev@python.org/thread/UGXWIADYG..., pointing out that in many cases the "main" type, now generic, has no documentation re: types other than the docs for the copy in typing module.

Not to sound exclusionary, but IMO most of the people interested in generic alias' docs are already following this list. I'm not sure if you'd get a better response on python-dev. We do have a docs WG and a documentation team. I think they might be on https://discuss.python.org/c/documentation/26, but I'm not too sure myself. Maybe https://docs-community.readthedocs.io/en/latest/ has some clues.

I also had difficulty finding this section, but the GenericAlias type is documented here: https://docs.python.org/3/library/stdtypes.html#types-genericalias It might be good to link to that section from the Generic one in the typing docs. On Mon, May 30, 2022, 6:04 PM Paul Bryan <pbryan@anode.ca> wrote:

That section doesn't cover the specific generic type alias conventions for each of the types (e.g, tuple[t0, t1] vs. tuple[t, ...], dict[key_t, value_t], etc. Would it make sense to bake these into the docstrings of each of the types for easy reference? On Mon, 2022-05-30 at 19:59 -0700, Ethan Smith wrote:

There was a similar thread about this here, https://mail.python.org/archives/list/python-dev@python.org/thread/UGXWIADYG..., pointing out that in many cases the "main" type, now generic, has no documentation re: types other than the docs for the copy in typing module.

Not to sound exclusionary, but IMO most of the people interested in generic alias' docs are already following this list. I'm not sure if you'd get a better response on python-dev. We do have a docs WG and a documentation team. I think they might be on https://discuss.python.org/c/documentation/26, but I'm not too sure myself. Maybe https://docs-community.readthedocs.io/en/latest/ has some clues.
participants (4)
-
asafspades@gmail.com
-
Ethan Smith
-
Ken Jin
-
Paul Bryan