Skip to content

False positive invalid-sequence-index with scipy.fft.rfft #8018

Open

Description

Bug description

# pylint: disable=missing-module-docstring, missing-function-docstring
# Using scipy.fft.rfft causes the error, removing this line also removes the error
# Seems related to issue #7702

import numpy as np
from scipy.fft import rfft


def some_func():
    arr = np.array([[1, 2, 3], [4, 5, 6]])
    arr_fft = rfft(arr)

    print(arr_fft[:, 0:2])

Command used

pylint false_positive_pylint.py

Pylint output

************* Module false_positive_pylint
false_positive_pylint.py:11:10: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)

------------------------------------------------------------------
Your code has been rated at 3.75/10 (previous run: 3.75/10, +0.00)

Expected behavior

No error reported

Pylint version

pylint 2.15.9
astroid 2.12.13
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)]

OS / Environment

Windows 10 using Powershell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

False Positive 🦟A message is emitted but nothing is wrong with the codeLib specific 💅This affect the code from a particular library

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions