KEMBAR78
Fixes mypy crash on `dataclasses.field(**unpack)` by sobolevn · Pull Request #11137 · python/mypy · GitHub
Skip to content

Conversation

sobolevn
Copy link
Member

Closes #10879

class bool(int): pass
class dict(Generic[_T, _U]): pass

class dict(Mapping[KT, VT]):
Copy link
Member Author

Choose a reason for hiding this comment

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

We need this for **dict unpack.

@hauntsaninja hauntsaninja merged commit a7d6e68 into python:master Sep 21, 2021
JukkaL pushed a commit that referenced this pull request Sep 24, 2021
)

Fixes #10248

The crash due to dataclasses.field was fixed in the recent PR #11137, but the error 
message was wrong when positional arguments are used.

I update the error message based on 
#10248 (comment)
(Thanks @JelleZijlstra!)
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.

Dataclasses: field function called with ** (double asterisk, unpack-dictionary) results in internal error

3 participants