Skip to content

Deprecate redundant type checking guard utils#8433

Merged
Pierre-Sassoulas merged 7 commits intopylint-dev:mainfrom
jacobtylerwalls:type-checking-deprecations
Mar 12, 2023
Merged

Deprecate redundant type checking guard utils#8433
Pierre-Sassoulas merged 7 commits intopylint-dev:mainfrom
jacobtylerwalls:type-checking-deprecations

Conversation

@jacobtylerwalls
Copy link
Copy Markdown
Member

Type of Changes

Type
🔨 Refactoring

Description

Suggesting we backport this to 2.17.x so that we can get the notice out before 3.0.

DanielNoord
DanielNoord previously approved these changes Mar 11, 2023
@jacobtylerwalls jacobtylerwalls force-pushed the type-checking-deprecations branch from 57202bd to 27f0193 Compare March 11, 2023 17:47
@jacobtylerwalls jacobtylerwalls added the Maintenance Discussion or action around maintaining pylint or the dev workflow label Mar 11, 2023
@jacobtylerwalls jacobtylerwalls changed the title [WIP] Deprecate redundant type checking guard utils Deprecate redundant type checking guard utils Mar 11, 2023
@jacobtylerwalls jacobtylerwalls marked this pull request as ready for review March 11, 2023 18:00
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2023

Codecov Report

Merging #8433 (9a6039b) into main (74e6efc) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8433      +/-   ##
==========================================
- Coverage   95.73%   95.72%   -0.01%     
==========================================
  Files         174      174              
  Lines       18392    18401       +9     
==========================================
+ Hits        17607    17614       +7     
- Misses        785      787       +2     
Impacted Files Coverage Δ
pylint/checkers/imports.py 94.34% <100.00%> (+0.01%) ⬆️
pylint/checkers/utils.py 95.84% <100.00%> (-0.19%) ⬇️
pylint/checkers/variables.py 97.16% <100.00%> (+<0.01%) ⬆️
pylint/extensions/private_import.py 99.17% <100.00%> (ø)

... and 1 file with indirect coverage changes

@github-actions

This comment has been minimized.

Copy link
Copy Markdown
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.

Kinda wondering if this should be part of the astroid's node API. It would be conveniant and discoverable.

@jacobtylerwalls
Copy link
Copy Markdown
Member Author

Kinda wondering if this should be part of the astroid's node API.

😅
https://github.com/PyCQA/astroid/blob/395bfbd670a6bf3fa043f5e7b509b9df5b83a714/ChangeLog#L43-L46

@Pierre-Sassoulas
Copy link
Copy Markdown
Member

Yeah I remember that, but how are we going to handle control flow ? It seems like this is similar to control flow understanding. And imo it will need to be object oriented instead of functional if we want them to be easy to use (if there was a single function on the node for that we would not have created 3/4 identical functions to solve a single problem?).

@jacobtylerwalls
Copy link
Copy Markdown
Member Author

Gotcha. I see how control flow ideas can be similar to astroid.are_exclusive. But I think with something all mixed up like this, where we're also inferring names in the middle, is not really a pure-ast-analysis thing like are_exclusive. I don't have a strong opinion though.

@Pierre-Sassoulas
Copy link
Copy Markdown
Member

Anyway, it's going to be a design discussion in astroid later, and we need to deprecate the duplicated functions in any cases.

Comment thread doc/whatsnew/fragments/8433.user_action
@github-actions
Copy link
Copy Markdown
Contributor

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 9a6039b

@Pierre-Sassoulas Pierre-Sassoulas merged commit b968fa0 into pylint-dev:main Mar 12, 2023
github-actions Bot pushed a commit that referenced this pull request Mar 12, 2023
@jacobtylerwalls jacobtylerwalls deleted the type-checking-deprecations branch March 12, 2023 12:15
Pierre-Sassoulas pushed a commit that referenced this pull request Mar 12, 2023
(cherry picked from commit b968fa0)

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported Maintenance Discussion or action around maintaining pylint or the dev workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants