Skip to content

False positive unexpected-keyword-arg with scipy.stats 1.17 #10831

@sam-s

Description

@sam-s

Bug description

scipy.stats.entropy accepts nan_policy but pylint does not seem to know it:

"https://github.com/pylint-dev/pylint/issues/10831"
import numpy as np
from scipy import stats as st
print(st.entropy([1,2,3,np.nan], nan_policy="omit"))

This is a regression with SciPy Version: 1.17.0 released January 11, 2026.
The warning does not appear with scipy-1.16.3.

Command used

pylint pylint-10831.py

Pylint output

pylint-10831.py:4:6: E1123: Unexpected keyword argument 'nan_policy' in function call (unexpected-keyword-arg)

Expected behavior

no diagnostics, the code works as expected and prints

np.float64(1.0114042647073518)

Pylint version

pylint 4.0.4
astroid 4.0.3
Python 3.14.2 (tags/v3.14.2:df79316, Dec  5 2025, 17:18:21) [MSC v.1944 64 bit (AMD64)]

OS / Environment

windows

Additional dependencies

numpy==2.4.1
scipy==1.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs triage 📥Just created, needs acknowledgment, triage, and proper labelling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions