bpo-44524: Fix an issue wherein `_GenericAlias._name` was not properly set for specialforms by BvB93 · Pull Request #27614 · python/cpython · GitHub
Skip to content

bpo-44524: Fix an issue wherein _GenericAlias._name was not properly set for specialforms - #27614

Merged
ambv merged 4 commits into
python:mainfrom
BvB93:name
Aug 6, 2021
Merged

ambv merged 4 commits into
python:mainfrom
BvB93:name

Conversation

@BvB93

@BvB93 BvB93 commented Aug 5, 2021

Copy link
Copy Markdown
Contributor

An example from prior to this PR:

>>> from typing import Union
>>> print(Union[int, float].__name__)
None

https://bugs.python.org/issue44524

@Fidget-Spinner Fidget-Spinner added needs backport to 3.10 only security fixes type-bug An unexpected behavior, bug, or error labels Aug 5, 2021

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM in general. Thanks for the quick fix :). I just have a few minor comments below.

Comment thread Lib/test/test_typing.py
Comment thread Misc/NEWS.d/next/Library/2021-08-05-18-20-17.bpo-44524.9T1tfe.rst Outdated
Comment thread Lib/typing.py Outdated
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great. Thanks!

@ambv

ambv commented Aug 6, 2021

Copy link
Copy Markdown
Contributor

@ambv
ambv merged commit 8bdf12e into python:main Aug 6, 2021
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @BvB93 for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 6, 2021
…y set for specialforms (pythonGH-27614)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 8bdf12e)

Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
@bedevere-bot

Copy link
Copy Markdown

GH-27632 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Aug 6, 2021
@BvB93
BvB93 deleted the name branch August 6, 2021 13:40
miss-islington added a commit that referenced this pull request Aug 6, 2021
…y set for specialforms (GH-27614)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 8bdf12e)

Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
@pablogsal

Copy link
Copy Markdown
Member

Unfortunately this PR has introduced reference leaks:

❯ ./python -m test test_typing -R :
0:00:00 load avg: 1.12 Run tests sequentially
0:00:00 load avg: 1.12 [1/1] test_typing
beginning 9 repetitions
123456789
.........
test_typing leaked [29, 29, 29, 29] references, sum=116
test_typing leaked [10, 10, 10, 10] memory blocks, sum=40
test_typing failed (reference leak)

== Tests result: FAILURE ==

1 test failed:
    test_typing

1 re-run test:
    test_typing

Total duration: 1.2 sec
Tests result: FAILURE

@ambv

ambv commented Aug 7, 2021

Copy link
Copy Markdown
Contributor

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

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants