Skip to content

Conversation

efimov-mikhail
Copy link
Contributor

@efimov-mikhail efimov-mikhail commented Oct 10, 2025

@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
Copy link
Contributor Author

CC @sobolevn

@efimov-mikhail
Copy link
Contributor Author

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

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@efimov-mikhail
Copy link
Contributor Author

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

@AlexWaygood AlexWaygood removed their request for review October 11, 2025 23:56
@efimov-mikhail
Copy link
Contributor 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.

@efimov-mikhail
Copy link
Contributor Author

efimov-mikhail commented Oct 15, 2025

Sorry for ping, @JelleZijlstra.

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

@JelleZijlstra JelleZijlstra merged commit f673f0e into python:main Oct 15, 2025
45 checks passed
@efimov-mikhail
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants