GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-139817: Attribute `__qualname__` is added to `TypeAliasType` by efimov-mikhail · Pull Request #139919 · python/cpython

Conversation

@efimov-mikhail

@efimov-mikhail efimov-mikhail commented Oct 10, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: TypeAliasType objects have no __qualname__ #139817

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@efimov-mikhail
efimov-mikhail requested a review from JelleZijlstra as a code owner October 10, 2025 18:58
@bedevere-app bedevere-app Bot added the awaiting review label Oct 10, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Oct 10, 2025
TypeAliasType objects have no __qualname__ #139817
Closed
@efimov-mikhail efimov-mikhail changed the title gh-139817: Parameter __qualname__ is added to TypeAliasType gh-139817: Attribute __qualname__ is added to TypeAliasType Oct 10, 2025
@efimov-mikhail

efimov-mikhail commented Oct 10, 2025

Copy link
Copy Markdown
Member Author

CC @sobolevn

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@efimov-mikhail

efimov-mikhail commented Oct 10, 2025

Copy link
Copy Markdown
Member Author

I'm totally not sure that this solution is fully correct.
But it works in typical situations, and improves introspection.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

efimov-mikhail added 2 commits October 10, 2025 22:10
@efimov-mikhail
Parameter __qualname__ is added to TypeAliasType
2bb3089
@efimov-mikhail
Typo fix
c9f3f8b
JelleZijlstra
JelleZijlstra reviewed Oct 11, 2025
View reviewed changes

@JelleZijlstra JelleZijlstra left a comment

Copy link
Copy Markdown
Member

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.

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Objects/typevarobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/typevarobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_type_aliases.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@efimov-mikhail
efimov-mikhail requested a review from AlexWaygood as a code owner October 11, 2025 22:12
@efimov-mikhail
efimov-mikhail requested a review from JelleZijlstra October 11, 2025 22:13
@efimov-mikhail

efimov-mikhail commented Oct 11, 2025

Copy link
Copy Markdown
Member Author

I've added some tests on __name__ and __qualname__, docs and news

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@efimov-mikhail
Tests on __qualname__, docs and news
ef9609a
@AlexWaygood
AlexWaygood removed their request for review October 11, 2025 23:56
JelleZijlstra
JelleZijlstra approved these changes Oct 11, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Oct 11, 2025
JelleZijlstra
JelleZijlstra reviewed Oct 12, 2025
View reviewed changes
Comment thread Objects/typevarobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@efimov-mikhail
Parameter qualname is added to TypeAliasType constructor
20b8987
@efimov-mikhail

efimov-mikhail commented Oct 12, 2025

Copy link
Copy Markdown
Member Author

I've added new constructor parameter: X = TypeAliasType("X", int, qualname="foo.X"). It looks like there is no much extra complexity and this solution is OK. But we can provide another variant, if it's needed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

efimov-mikhail added 2 commits October 12, 2025 12:50
@efimov-mikhail
Test for qualname=None in constructor is added.
9497c90
@efimov-mikhail
Merge branch 'main' into issue-139817-type-alias-qualname
730436a
JelleZijlstra
JelleZijlstra reviewed Oct 12, 2025
View reviewed changes
Comment thread Objects/typevarobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@efimov-mikhail efimov-mikhail mentioned this pull request Oct 12, 2025
gh-140000: Traverse name attribute for TypeVar, TypeVarTuple, TypeAliasType, ParamSpec #140016
Merged
efimov-mikhail added 2 commits October 14, 2025 04:45
@efimov-mikhail
Merge branch 'main' into issue-139817-type-alias-qualname
9c7b17b
@efimov-mikhail
Correct using of qualname in traverse/clear/dealloc
10e0c36
@efimov-mikhail
efimov-mikhail requested a review from JelleZijlstra October 14, 2025 02:28
@efimov-mikhail

efimov-mikhail commented Oct 15, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Sorry for ping, @JelleZijlstra.

This PR could be merged, or I've missed something?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra
JelleZijlstra merged commit f673f0e into python:main Oct 15, 2025
4 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Oct 15, 2025
@efimov-mikhail

efimov-mikhail commented Oct 15, 2025

Copy link
Copy Markdown
Member Author

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
@efimov-mikhail @StanFromIreland
pythongh-139817: Attribute __qualname__ is added to TypeAliasType (…
13369a1
…python#139919)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra Awaiting requested review from JelleZijlstra JelleZijlstra is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@efimov-mikhail @JelleZijlstra
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.