Skip to content

gh-132467: Add test case to check whether GenericAlias instance is not class, update docstring of typing._GenericAlias#133504

Merged
JelleZijlstra merged 8 commits into
python:mainfrom
Abduaziz-Projects:genericalias-isclass-test
Jun 3, 2026
Merged

gh-132467: Add test case to check whether GenericAlias instance is not class, update docstring of typing._GenericAlias#133504
JelleZijlstra merged 8 commits into
python:mainfrom
Abduaziz-Projects:genericalias-isclass-test

Conversation

@AbduazizZiyodov
Copy link
Copy Markdown
Contributor

@AbduazizZiyodov AbduazizZiyodov commented May 6, 2025

Description

As discussed in the issue, we can't change behaviour of inspect.isclass for GenericAlias instances, so that we need to document that they are not considered to be a class.

Summary

  • Added one test case
  • Updated docstring of typing._GenericAlias. Added one note, changed format of docstring a bit
  • Online docs was also updated

* edit: I should not have updated typing docs, doc was for typing spec only, not about runtime behaviour. So I updated stdtypes docs.

…d to be class, update docstring of typing._GenericAlias
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 6, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 6, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 6, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 6, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Comment thread Doc/library/stdtypes.rst Outdated
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 7, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@AbduazizZiyodov
Copy link
Copy Markdown
Contributor Author

Hi @JelleZijlstra, I(we)'ve addressed requested changes, just checking in if there is anything needed from my side? Thanks.

@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 24, 2026
Comment thread Doc/library/stdtypes.rst Outdated
Comment thread Lib/typing.py Outdated
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented Jun 3, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented Jun 3, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented Jun 3, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@JelleZijlstra JelleZijlstra added skip news needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jun 3, 2026
@JelleZijlstra JelleZijlstra enabled auto-merge (squash) June 3, 2026 13:10
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32972747 | 📁 Comparing 9a22782 against main (6453065)

  🔍 Preview build  

1 file changed
± library/stdtypes.html

@JelleZijlstra JelleZijlstra merged commit 5915a1f into python:main Jun 3, 2026
60 checks passed
@miss-islington-app
Copy link
Copy Markdown

Thanks @AbduazizZiyodov for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@miss-islington-app
Copy link
Copy Markdown

Sorry, @AbduazizZiyodov and @JelleZijlstra, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 5915a1fb9d8499387e371c6801b40c55cf126dbf 3.14

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented Jun 3, 2026

GH-150854 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jun 3, 2026
@miss-islington-app
Copy link
Copy Markdown

Sorry, @AbduazizZiyodov and @JelleZijlstra, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 5915a1fb9d8499387e371c6801b40c55cf126dbf 3.13

@AbduazizZiyodov AbduazizZiyodov deleted the genericalias-isclass-test branch June 3, 2026 13:36
@JelleZijlstra
Copy link
Copy Markdown
Member

@AbduazizZiyodov thanks for contributing! Do you want to see if you can get the backports to 3.13 and 3.14 up?

JelleZijlstra added a commit that referenced this pull request Jun 3, 2026
…ses (GH-133504) (#150854)

gh-132467: Document and test that generic aliases are not classes (GH-133504)
(cherry picked from commit 5915a1f)

Co-authored-by: Abduaziz π <mail@ziyodov.uz>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants