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

Change _get_assign_nodes() to cached_property #2051

Merged

Conversation

jacobtylerwalls
Copy link
Member

Type of Changes

Type
🐛 Bug fix

Description

cached_property does a much better job cleaning up after itself than we're doing.

Refs #1780

@jacobtylerwalls jacobtylerwalls added pylint-tested PRs that don't cause major regressions with pylint Maintenance Discussion or action around maintaining astroid or the dev workflow backport maintenance/2.15.x labels Mar 12, 2023
Copy link
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

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

Pehaps out of scope, but this seems to indicate that this returns list[nodes.Assign]? Perhaps nice to add as well?

Anyway, I feel like the name doesn't really do the property justice anymore. What about something like _assign_nodes_in_scope?

@codecov
Copy link

codecov bot commented Mar 12, 2023

Codecov Report

Merging #2051 (dcd6a69) into main (c752c33) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2051      +/-   ##
==========================================
- Coverage   92.82%   92.82%   -0.01%     
==========================================
  Files          95       95              
  Lines       11066    11065       -1     
==========================================
- Hits        10272    10271       -1     
  Misses        794      794              
Flag Coverage Δ
linux 92.54% <100.00%> (-0.01%) ⬇️
pypy 88.16% <100.00%> (-0.01%) ⬇️
windows 92.38% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
astroid/nodes/_base_nodes.py 98.14% <100.00%> (-0.02%) ⬇️
astroid/nodes/node_classes.py 95.05% <100.00%> (ø)
astroid/nodes/node_ng.py 93.07% <100.00%> (ø)
astroid/nodes/scoped_nodes/scoped_nodes.py 93.07% <100.00%> (ø)

@jacobtylerwalls jacobtylerwalls merged commit 99f519a into pylint-dev:main Mar 12, 2023
@jacobtylerwalls jacobtylerwalls deleted the _get_assign_names-cached-prop branch March 12, 2023 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining astroid or the dev workflow pylint-tested PRs that don't cause major regressions with pylint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants