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

Use UninferableBase instead of Uninferable #8384

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

DanielNoord
Copy link
Collaborator

Type of Changes

Type
βœ“ πŸ”¨ Refactoring

Description

Blocked on the new astroid release.

@DanielNoord DanielNoord added Needs astroid update Needs an astroid update (probably a release too) before being mergable Skip news πŸ”‡ This change does not require a changelog entry labels Mar 5, 2023
@DanielNoord DanielNoord added this to the 2.17.0 milestone Mar 5, 2023
@DanielNoord DanielNoord requested a review from DudeNr33 as a code owner March 5, 2023 23:06
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.

I thought UninferableBase was for typing purpose only ? I like the is Uninferable a lot, it's pretty pythonic imo.

@DanielNoord
Copy link
Collaborator Author

I thought UninferableBase was for typing purpose only ? I like the is Uninferable a lot, it's pretty pythonic imo.

We made a similar change in astroid as well, see pylint-dev/astroid#1741.

The isinstance check helps actually narrow down the type of these variables for mypy and other tools so I guess it makes sense to do this here as well.

@codecov
Copy link

codecov bot commented Mar 5, 2023

Codecov Report

Merging #8384 (3bf0c78) into main (9c4fbed) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8384   +/-   ##
=======================================
  Coverage   95.57%   95.57%           
=======================================
  Files         178      178           
  Lines       18763    18764    +1     
=======================================
+ Hits        17932    17934    +2     
+ Misses        831      830    -1     
Impacted Files Coverage Ξ”
pylint/checkers/async.py 97.77% <100.00%> (ΓΈ)
pylint/checkers/base/basic_checker.py 97.87% <100.00%> (ΓΈ)
pylint/checkers/classes/class_checker.py 93.73% <100.00%> (ΓΈ)
pylint/checkers/classes/special_methods_checker.py 95.48% <100.00%> (ΓΈ)
pylint/checkers/dunder_methods.py 100.00% <100.00%> (ΓΈ)
pylint/checkers/exceptions.py 97.85% <100.00%> (ΓΈ)
...heckers/refactoring/implicit_booleaness_checker.py 100.00% <100.00%> (ΓΈ)
pylint/checkers/refactoring/refactoring_checker.py 98.33% <100.00%> (ΓΈ)
pylint/checkers/stdlib.py 96.70% <100.00%> (ΓΈ)
pylint/checkers/strings.py 94.07% <100.00%> (ΓΈ)
... and 7 more

@github-actions

This comment has been minimized.

@jacobtylerwalls
Copy link
Member

Nice FP fixes in the primer comment related to #5288/#8385.

jacobtylerwalls
jacobtylerwalls previously approved these changes Mar 6, 2023
Comment on lines -1572 to +1574
if Uninferable in (assignees, values):
if any(isinstance(n, UninferableBase) for n in (assignees, values)):
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated to this PR, but this looks fishy. Why would Uninferable be in a tuple of lists? πŸ€”

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah.. I guess elts is Uninferable sometimes? Or this is just 100% broken..

Copy link
Member

Choose a reason for hiding this comment

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

Would you mind opening a follow up issue to investigate?

@github-actions

This comment has been minimized.

jacobtylerwalls
jacobtylerwalls previously approved these changes Mar 6, 2023
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.

πŸ‘ But blocked by #8387 I guess.

@DanielNoord DanielNoord enabled auto-merge (rebase) March 7, 2023 20:52
@DanielNoord DanielNoord merged commit b4fe93a into pylint-dev:main Mar 7, 2023
@DanielNoord DanielNoord deleted the uninferable branch March 7, 2023 20:54
@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2023

πŸ€– Effect of this PR on checked open source code: πŸ€–

Effect on music21:
The following messages are no longer emitted:

  1. unsubscriptable-object:
    Value 'midiEventList' is unsubscriptable
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/midi/translate.py#L1359

Effect on sentry:
The following messages are no longer emitted:

  1. unsubscriptable-object:
    Value '_from_email_domain_cache' is unsubscriptable
    https://github.com/getsentry/sentry/blob/5959c5be7a50c32cc79c98447807bf0521994a17/src/sentry/utils/email/address.py#L26

This comment was generated for commit 3bf0c78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs astroid update Needs an astroid update (probably a release too) before being mergable Skip news πŸ”‡ This change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants