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

Add filter for abc.collections in dataclass inference #1143

Conversation

david-yz-liu
Copy link
Contributor

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

Okay, so the filter introduced in #1130 correctly excluded imports from typing, but didn't exclude imports from collections.abc. Fixed that by adding the module's name to the existing filter. Note: the module defines its __name__ as 'collections.abc', but the .name node attribute is generated from the file name, _collections_abc.py.

Type of Changes

Type
🐛 Bug fix

Related Issue

Closes pylint-dev/pylint#4895

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.7.3 milestone Aug 22, 2021
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

👌 Thanks for the fast and straightforward fix !

@Pierre-Sassoulas Pierre-Sassoulas merged commit 9d40bb3 into pylint-dev:main Aug 22, 2021
@david-yz-liu david-yz-liu deleted the dataclass-type-hints-collections branch August 22, 2021 19:55
@david-yz-liu
Copy link
Contributor Author

No problem, I'm trying to keep an eye out for dataclass type-related issues 😅

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.

Unpacking-non-sequence raises error for Callable in collections.abc
2 participants