Skip to content

Wrong inference with default argument values#2914

Merged
jacobtylerwalls merged 10 commits intopylint-dev:mainfrom
jkmnt:bug-2899
Jan 3, 2026
Merged

Wrong inference with default argument values#2914
jacobtylerwalls merged 10 commits intopylint-dev:mainfrom
jkmnt:bug-2899

Conversation

@jkmnt
Copy link
Copy Markdown
Contributor

@jkmnt jkmnt commented Dec 16, 2025

This is a q&d draft PR fixing #2899: Wrong inference with default argument values.
I've added the same test as in reported issue.

I'm not an expert on Astroid. Maybe it brokes something else. pytest -k inference is passing ok.

Closes #2899

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.41%. Comparing base (225d964) to head (84b085d).
⚠️ Report is 94 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2914      +/-   ##
==========================================
- Coverage   93.41%   93.41%   -0.01%     
==========================================
  Files          92       92              
  Lines       11230    11237       +7     
==========================================
+ Hits        10491    10497       +6     
- Misses        739      740       +1     
Flag Coverage Δ
linux 93.26% <100.00%> (-0.03%) ⬇️
pypy 93.41% <100.00%> (-0.01%) ⬇️
windows 93.39% <100.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
astroid/nodes/node_classes.py 95.00% <100.00%> (+0.06%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Pierre-Sassoulas
Copy link
Copy Markdown
Member

Thank you for opening the PR @jkmnt. This look reasonable to me. I'm going to have to approve the pipeline each time online because this is your first contribution, but you can install pre-commit locally to launch the linter.

@jkmnt
Copy link
Copy Markdown
Contributor Author

jkmnt commented Dec 16, 2025

Ok! Installed local pre-commit and added another test to increase changes coverage.

@jkmnt jkmnt marked this pull request as ready for review December 16, 2025 19:45
@jacobtylerwalls jacobtylerwalls self-requested a review January 3, 2026 05:17
@jacobtylerwalls jacobtylerwalls added the pylint-tested PRs that don't cause major regressions with pylint label Jan 3, 2026
jacobtylerwalls
jacobtylerwalls previously approved these changes Jan 3, 2026
Copy link
Copy Markdown
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!

@jacobtylerwalls jacobtylerwalls enabled auto-merge (squash) January 3, 2026 20:00
@jacobtylerwalls jacobtylerwalls merged commit 178a796 into pylint-dev:main Jan 3, 2026
19 checks passed
pylint-backport Bot pushed a commit that referenced this pull request Jan 3, 2026
jacobtylerwalls pushed a commit that referenced this pull request Jan 3, 2026
…lues (#2924)

Fix overzealous filtering of `IfExp` inference (#2914)

(cherry picked from commit 178a796)

Co-authored-by: jkmnt <git@firewood.fastmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug 🪳 pylint-tested PRs that don't cause major regressions with pylint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong inference with default argument values

3 participants