[issue44392] Py_GenericAlias is not documented

2021-06-16 Thread Ken Jin
Ken Jin added the comment: I'm closing this issue as all the relevant PRs have landed. Thanks everyone! @Ronald > Why should this be deprecated at all? I can't speak for others, but personally I think it's here to stay (for the many reasons raised in the previous messages). Thanks for catch

[issue44392] Py_GenericAlias is not documented

2021-06-16 Thread miss-islington
miss-islington added the comment: New changeset c7e95715ec2f2a16eace7aa35a1eb2f18e8d06ed by Ken Jin in branch '3.9': [3.9] bpo-44392: Add Py_GenericAlias to C API docs (GH-26724) (GH-26757) https://github.com/python/cpython/commit/c7e95715ec2f2a16eace7aa35a1eb2f18e8d06ed -- ___

[issue44392] Py_GenericAlias is not documented

2021-06-16 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +25342 pull_request: https://github.com/python/cpython/pull/26757 ___ Python tracker ___ ___ P

[issue44392] Py_GenericAlias is not documented

2021-06-16 Thread miss-islington
miss-islington added the comment: New changeset 84ce737f73136c1de7c4dc92bc096ed6c963e42d by Miss Islington (bot) in branch '3.10': bpo-44392: Add Py_GenericAlias to C API docs (GH-26724) https://github.com/python/cpython/commit/84ce737f73136c1de7c4dc92bc096ed6c963e42d -- __

[issue44392] Py_GenericAlias is not documented

2021-06-16 Thread Guido van Rossum
Guido van Rossum added the comment: Does it need a backport to 3.9 too, since GenericAlias was introduced there? -- ___ Python tracker ___

[issue44392] Py_GenericAlias is not documented

2021-06-16 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +25341 pull_request: https://github.com/python/cpython/pull/26756 ___ Python tracker _

[issue44392] Py_GenericAlias is not documented

2021-06-16 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 6773c3eaa735b5061b4a97f2c730703a32d8c9ff by Ken Jin in branch 'main': bpo-44392: Add Py_GenericAlias to C API docs (GH-26724) https://github.com/python/cpython/commit/6773c3eaa735b5061b4a97f2c730703a32d8c9ff -- _

[issue44392] Py_GenericAlias is not documented

2021-06-15 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +25325 pull_request: https://github.com/python/cpython/pull/26739 ___ Python tracker ___ ___ P

[issue44392] Py_GenericAlias is not documented

2021-06-14 Thread Ronald Oussoren
Ronald Oussoren added the comment: Why should this be deprecated at all? The API is a convenient way to add ``__class_getitem__`` in a way that is consistent with the implementation for builtin types and the stdlib. I noticed the lack of documentation when I worked on implementing this for

[issue44392] Py_GenericAlias is not documented

2021-06-14 Thread Petr Viktorin
Petr Viktorin added the comment: > Can we remove this from the stable API during beta? It was added (to PC/python3.def) in 3.9, so removing in 3.10 beta wouldn't be good. It can be deprecated; should it? -- ___ Python tracker

[issue44392] Py_GenericAlias is not documented

2021-06-14 Thread Ken Jin
Ken Jin added the comment: (Copied over from the PR) BTW, I also noticed the stable ABI manifest exposes the wrong return type for Py_GenericAliasType. It exposes it as a function when it's a var/type/struct. So I fixed that in the PR too otherwise the docs weren't compiling (I can split th

[issue44392] Py_GenericAlias is not documented

2021-06-14 Thread Guido van Rossum
Guido van Rossum added the comment: Maybe the docs then should contain a more-or-less complete example showing how a 3rd party type should use this? -- ___ Python tracker ___

[issue44392] Py_GenericAlias is not documented

2021-06-14 Thread Ken Jin
Ken Jin added the comment: > maybe it was a mistake to expose this I was wondering if this was accidentally added at the time too. > Remind me what use is made of this from C code It's required for a C extension type to implement the __class_getitem__ method properly. Eg. ``MyCType[int]``.

[issue44392] Py_GenericAlias is not documented

2021-06-14 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: They'd still need runtime support from GenericAlias to allow users to write `numpy.ndarray[int]` at runtime. -- ___ Python tracker ___ _

[issue44392] Py_GenericAlias is not documented

2021-06-14 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, but is that what they are doing? I assume that they use stub files, since static type checkers don’t introspect the runtime API. -- ___ Python tracker

[issue44392] Py_GenericAlias is not documented

2021-06-14 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: It could be useful for C extensions that want to support PEP 585 for their types, such as numpy's array type. -- nosy: +Jelle Zijlstra ___ Python tracker __

[issue44392] Py_GenericAlias is not documented

2021-06-14 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, maybe it was a mistake to expose this? Remind me what use is made of this from C code? Can we remove this from the stable API during beta? It was never exposed before. -- nosy: +Guido.van.Rossum ___ Python t

[issue44392] Py_GenericAlias is not documented

2021-06-14 Thread Ken Jin
Change by Ken Jin : -- keywords: +patch pull_requests: +25314 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26724 ___ Python tracker ___

[issue44392] Py_GenericAlias is not documented

2021-06-14 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'm not working on this. Feel free to work on a PR. -- ___ Python tracker ___ ___ Python-bugs-li

[issue44392] Py_GenericAlias is not documented

2021-06-11 Thread Ken Jin
Ken Jin added the comment: Ronald, may I take this please? Or are you working on something already? -- nosy: +gvanrossum, kj ___ Python tracker ___ ___

[issue44392] Py_GenericAlias is not documented

2021-06-11 Thread Ronald Oussoren
New submission from Ronald Oussoren : Py_GenericAlias seems to be a public API given its name and is mention in the stable ABI list for 3.10 (https://docs.python.org/3.10/c-api/stable.html?highlight=py_genericalias), but the API is not documented. Likewise for Py_GenericAliasType.