Skip to content

unused-import when readline is imported to enhance input() #8652

Open
@michalfabik

Description

@michalfabik

Bug description

#pylint: disable=missing-docstring

import readline

input()

Command used

pylint-3 a.py

Pylint output

************* Module a
a.py:4:0: W0611: Unused import readline (unused-import)

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

Expected behavior

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

"If the readline module was loaded, then input() will use it to provide elaborate line editing and history features." (https://docs.python.org/3/library/functions.html?highlight=input#input)

Pylint version

$ pylint-3 --version
pylint 2.14.4
astroid 2.12.14
Python 3.11.2 (main, Feb  8 2023, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)]
$

OS / Environment

Fedora 37

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Positive 🦟A message is emitted but nothing is wrong with the codeNeeds decision 🔒Needs a decision before implemention or rejectionNeeds specification 🔐Accepted as a potential improvement, and needs to specify edge cases, message names, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions