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

Improve typing.TypedDict inference #915

Merged
merged 4 commits into from
Feb 28, 2021

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Feb 28, 2021

Steps

  • For new features or bug fixes, add a ChangeLog entry describing what your PR does.
  • Write a good description on what the PR does.

Description

Beginning with Python 3.9 typing.TypedDicts are defined as functions instead of classes. That causes inherit-non-class errors in pylint. pylint-dev/pylint#4072 addressed it, but only by hiding the error message.

This change rewrites the TypedDict base from astroid.FunctionDef to astroid.ClassDef.

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
📜 Docs

Related Issue

pylint-dev/pylint#4072

astroid/brain/brain_typing.py Outdated Show resolved Hide resolved
@cdce8p cdce8p mentioned this pull request Feb 28, 2021
2 tasks
@Pierre-Sassoulas Pierre-Sassoulas merged commit d8f2fab into pylint-dev:master Feb 28, 2021
@cdce8p cdce8p deleted the typedDict-transform branch February 28, 2021 17:15
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