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

Emit assignment-from-no-return for builtin methods like dict.update() #8817

Merged

Conversation

jacobtylerwalls
Copy link
Member

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

Follow-up to 32effc5.

Since we won't be merging assignment-from-no-return with assignment-from-none, we should emit the correct message for builtins like list.sort() and dict.update(). Only list.sort() is a behavior change from stable versions.

Closes #8810

@jacobtylerwalls jacobtylerwalls added this to the 3.0.0a7 milestone Jul 3, 2023
@github-actions

This comment has been minimized.

Comment on lines 2 to 3
(Calls to ``list.sort()`` now raise ``assignment-from-no-return``
rather than ``assignment-from-none`` for consistency.)
Copy link
Member

Choose a reason for hiding this comment

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

You added that 2 days ago in #8809, right ? We probably don't need to advertise the change as it's unreleased.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
(Calls to ``list.sort()`` now raise ``assignment-from-no-return``
rather than ``assignment-from-none`` for consistency.)

Copy link
Member Author

@jacobtylerwalls jacobtylerwalls Jul 3, 2023

Choose a reason for hiding this comment

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

Actually, it's changed in this PR. In #8809 I added all the other methods besides list.sort() to the existing assignment-from-none, which is only correct if we were going to merge the messages. :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

list.sort() only was special-cased in #5738

@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Merging #8817 (0c0d952) into main (b00d3c9) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8817   +/-   ##
=======================================
  Coverage   95.89%   95.89%           
=======================================
  Files         173      173           
  Lines       18508    18508           
=======================================
  Hits        17749    17749           
  Misses        759      759           
Impacted Files Coverage Ξ”
pylint/checkers/typecheck.py 96.56% <100.00%> (ΓΈ)

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit 0c0d952

@jacobtylerwalls jacobtylerwalls merged commit dc1f5f6 into pylint-dev:main Jul 4, 2023
38 checks passed
@jacobtylerwalls jacobtylerwalls deleted the better-no-return-msg branch July 4, 2023 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emit assignment-from-no-return instead of assignment-from-none for implicitly returning stdlib calls
2 participants