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

Deprecate redundant type checking guard utils #8433

Merged

Conversation

jacobtylerwalls
Copy link
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 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

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
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
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
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
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
Member

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

@github-actions
Copy link
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