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

Rename cache-max-size-none and check functools.cache #6182

Merged
merged 7 commits into from Apr 19, 2022

Conversation

DanielNoord
Copy link
Collaborator

  • Add a ChangeLog entry describing what your PR does.
  • If it's a new feature, or an important bug fix, add a What's New entry in
    doc/whatsnew/<current release.rst>.
  • Write a good description on what the PR does.
  • If you used multiple emails or multiple names when contributing, add your mails
    and preferred name in script/.contributors_aliases.json

Type of Changes

Type
✨ New feature

Description

Closes #5670.

@DanielNoord DanielNoord added this to the 2.14.0 milestone Apr 4, 2022
@DanielNoord DanielNoord added the Enhancement ✨ Improvement to a component label Apr 4, 2022
@coveralls
Copy link

coveralls commented Apr 4, 2022

Pull Request Test Coverage Report for Build 2187900060

  • 11 of 11 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.0009%) to 95.151%

Totals Coverage Status
Change from base Build 2184960116: 0.0009%
Covered Lines: 15778
Relevant Lines: 16582

💛 - Coveralls

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.

Needs a documentation with good.py and bad.py too :)

pylint/checkers/stdlib.py Outdated Show resolved Hide resolved
@jacobtylerwalls
Copy link
Member

Haven't looked in detail yet, but why wouldn't this just be a case for the existing message for lru_cache(maxsize=None)? It seems a bit of a usability flaw to have to enable/disable both messages when they do/check the same thing.

@DanielNoord
Copy link
Collaborator Author

Haven't looked in detail yet, but why wouldn't this just be a case for the existing message for lru_cache(maxsize=None)? It seems a bit of a usability flaw to have to enable/disable both messages when they do/check the same thing.

The other message has lru... in it while the decorator doesn't. I can imagine people might wonder why we're complaining about lru_cache when they are using cache.

I'm fine with adding to the other message as well though

@jacobtylerwalls
Copy link
Member

jacobtylerwalls commented Apr 4, 2022

Yeah. It's hard because we've already released it. I feel like it should be renamed to something like cache-maxsize-none. But on the other hand we're addressing it really quickly in a patch release. I don't want to push too hard -- let's see what others think!

@DanielNoord
Copy link
Collaborator Author

Yeah. It's hard because we've already released it. I feel like it should be renamed to something like cache-max-size-none. But on the other hand we're addressing it really quickly in a patch release. I don't want to push too hard -- let's see what others think!

With old-names it is fairly trivial to rename it.

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.

Also agree that we should rename and merge the two message.

@DanielNoord DanielNoord marked this pull request as draft April 5, 2022 06:23
@DanielNoord
Copy link
Collaborator Author

@jacobtylerwalls Gentle ping 😄

ChangeLog Outdated Show resolved Hide resolved
doc/whatsnew/2.14.rst Outdated Show resolved Hide resolved
Copy link
Member

@jacobtylerwalls jacobtylerwalls 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 ping! Following Pierre's earlier comment, I'm also surprised this doesn't emit on pure functions. Was there a discussion elsewhere that clarified the reasoning?

DanielNoord and others added 2 commits April 12, 2022 21:13
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
@DanielNoord DanielNoord changed the title Add functools-cache-decorating-method checker Rename cache-max-size-none and check functools.cache Apr 19, 2022
@DanielNoord DanielNoord merged commit ac6efbf into pylint-dev:main Apr 19, 2022
@DanielNoord DanielNoord deleted the cache branch April 19, 2022 14:26
omarandlorraine pushed a commit to omarandlorraine/pylint that referenced this pull request Apr 19, 2022
…dev#6182)

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate use of lru_cache on methods
4 participants