Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor issues with keywords Unpack #13854

Merged
merged 1 commit into from
Oct 9, 2022

Conversation

ilevkivskyi
Copy link
Member

This fixes couple issues discovered in #13790:

  • A crash on empty Unpack
  • Wrong behavior with implicit generic Any

The latter was actually caused by somewhat reckless handling of generic TypedDicts, wrong argument count was handled inconsistently there.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thank you!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2022

Diff from mypy_primer, showing the effect of this PR on open source code:

xarray-dataclasses (https://github.com/astropenguin/xarray-dataclasses)
- xarray_dataclasses/datamodel.py:173: error: Bad number of arguments for type alias, expected: 0, given: 1  [misc]
+ xarray_dataclasses/datamodel.py:173: error: Bad number of arguments for type alias, expected: 0, given: 1  [type-arg]
- xarray_dataclasses/datamodel.py:189: error: Bad number of arguments for type alias, expected: 0, given: 1  [misc]
+ xarray_dataclasses/datamodel.py:189: error: Bad number of arguments for type alias, expected: 0, given: 1  [type-arg]

discord.py (https://github.com/Rapptz/discord.py)
- discord/utils.py:659: error: Bad number of arguments for type alias, expected: 0, given: 2  [misc]
+ discord/utils.py:659: error: Bad number of arguments for type alias, expected: 0, given: 2  [type-arg]
- discord/app_commands/tree.py:843: error: Bad number of arguments for type alias, expected: 0, given: 3  [misc]
+ discord/app_commands/tree.py:843: error: Bad number of arguments for type alias, expected: 0, given: 3  [type-arg]
- discord/app_commands/tree.py:877: error: Bad number of arguments for type alias, expected: 0, given: 3  [misc]
+ discord/app_commands/tree.py:877: error: Bad number of arguments for type alias, expected: 0, given: 3  [type-arg]
- discord/app_commands/commands.py:139: error: Bad number of arguments for type alias, expected: 0, given: 3  [misc]
+ discord/app_commands/commands.py:139: error: Bad number of arguments for type alias, expected: 0, given: 3  [type-arg]
- discord/app_commands/commands.py:656: error: Bad number of arguments for type alias, expected: 0, given: 3  [misc]
+ discord/app_commands/commands.py:656: error: Bad number of arguments for type alias, expected: 0, given: 3  [type-arg]
- discord/app_commands/commands.py:672: error: Bad number of arguments for type alias, expected: 0, given: 3  [misc]
+ discord/app_commands/commands.py:672: error: Bad number of arguments for type alias, expected: 0, given: 3  [type-arg]
- discord/app_commands/commands.py:716: error: Bad number of arguments for type alias, expected: 0, given: 3  [misc]
+ discord/app_commands/commands.py:716: error: Bad number of arguments for type alias, expected: 0, given: 3  [type-arg]
- discord/app_commands/commands.py:1921: error: Bad number of arguments for type alias, expected: 0, given: 3  [misc]
+ discord/app_commands/commands.py:1921: error: Bad number of arguments for type alias, expected: 0, given: 3  [type-arg]
- discord/app_commands/commands.py:1946: error: Bad number of arguments for type alias, expected: 0, given: 3  [misc]
+ discord/app_commands/commands.py:1946: error: Bad number of arguments for type alias, expected: 0, given: 3  [type-arg]
- discord/app_commands/commands.py:1980: error: Bad number of arguments for type alias, expected: 0, given: 3  [misc]
+ discord/app_commands/commands.py:1980: error: Bad number of arguments for type alias, expected: 0, given: 3  [type-arg]
- discord/app_commands/commands.py:2007: error: Bad number of arguments for type alias, expected: 0, given: 3  [misc]
+ discord/app_commands/commands.py:2007: error: Bad number of arguments for type alias, expected: 0, given: 3  [type-arg]
- discord/ext/commands/hybrid.py:487: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/hybrid.py:487: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]
- discord/ext/commands/hybrid.py:804: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/hybrid.py:804: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]
- discord/ext/commands/hybrid.py:814: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/hybrid.py:814: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]
- discord/ext/commands/hybrid.py:828: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/hybrid.py:828: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]
- discord/ext/commands/hybrid.py:838: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/hybrid.py:838: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]
- discord/ext/commands/hybrid.py:852: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/hybrid.py:852: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]
- discord/ext/commands/hybrid.py:890: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/hybrid.py:890: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]
- discord/ext/commands/hybrid.py:903: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/hybrid.py:903: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]
- discord/ext/commands/hybrid.py:920: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/hybrid.py:920: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]
- discord/ext/commands/bot.py:85: error: Bad number of arguments for type alias, expected: 0, given: 2  [misc]
+ discord/ext/commands/bot.py:85: error: Bad number of arguments for type alias, expected: 0, given: 2  [type-arg]
- discord/ext/commands/bot.py:86: error: Bad number of arguments for type alias, expected: 0, given: 1  [misc]
+ discord/ext/commands/bot.py:86: error: Bad number of arguments for type alias, expected: 0, given: 1  [type-arg]
- discord/ext/commands/bot.py:163: error: Bad number of arguments for type alias, expected: 0, given: 1  [misc]
+ discord/ext/commands/bot.py:163: error: Bad number of arguments for type alias, expected: 0, given: 1  [type-arg]
- discord/ext/commands/bot.py:172: error: Bad number of arguments for type alias, expected: 0, given: 1  [misc]
+ discord/ext/commands/bot.py:172: error: Bad number of arguments for type alias, expected: 0, given: 1  [type-arg]
- discord/ext/commands/bot.py:277: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/bot.py:277: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]
- discord/ext/commands/bot.py:287: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/bot.py:287: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]
- discord/ext/commands/bot.py:301: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/bot.py:301: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]
- discord/ext/commands/bot.py:311: error: Bad number of arguments for type alias, expected: 0, given: 4  [misc]
+ discord/ext/commands/bot.py:311: error: Bad number of arguments for type alias, expected: 0, given: 4  [type-arg]

Expression (https://github.com/cognitedata/Expression)
- expression/core/fn.py:25: error: Bad number of arguments for type alias, expected: 1, given: 2  [misc]
+ expression/core/fn.py:25: error: Bad number of arguments for type alias, expected: 1, given: 2  [type-arg]
- expression/core/fn.py:33: error: Bad number of arguments for type alias, expected: 1, given: 2  [misc]
+ expression/core/fn.py:33: error: Bad number of arguments for type alias, expected: 1, given: 2  [type-arg]
- expression/core/fn.py:48: error: Bad number of arguments for type alias, expected: 1, given: 2  [misc]
+ expression/core/fn.py:48: error: Bad number of arguments for type alias, expected: 1, given: 2  [type-arg]
- expression/core/fn.py:52: error: Bad number of arguments for type alias, expected: 1, given: 2  [misc]
+ expression/core/fn.py:52: error: Bad number of arguments for type alias, expected: 1, given: 2  [type-arg]

@ilevkivskyi ilevkivskyi merged commit 56258a6 into python:master Oct 9, 2022
@ilevkivskyi ilevkivskyi deleted the fix-unpack branch October 9, 2022 23:47
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