Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does I1101 mean in pylint

Tags:

pylint

What does I mean in pylint? I haven't seen an error message that starts with I before.

Based on https://docs.pylint.org/en/1.6.0/tutorial.html, I is not included in the following list

  * (C) convention, for programming standard violation
  * (R) refactor, for bad code smell
  * (W) warning, for python specific problems
  * (E) error, for much probably bugs in the code
  * (F) fatal, if an error occurred which prevented pylint from doing

It's related to a C++ extension.

Consider adding this module to extension-pkg-whitelist if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
like image 920
zyxue Avatar asked Oct 16 '22 00:10

zyxue


People also ask

What does Pylint check for?

Pylint analyses your code without actually running it. It checks for errors, enforces a coding standard, looks for code smells, and can make suggestions about how the code could be refactored. Pylint can infer actual values from your code using its internal code representation (astroid).

What is Pylint No member?

If you are getting the dreaded no-member error, there is a possibility that either: pylint found a bug in your code. You're launching pylint without the dependencies installed in its environment. pylint would need to lint a C extension module and is refraining to do so.

What is a Pylint in Python?

Pylint is a static code analysis tool for the Python programming language. It is named following a common convention in Python of a "py" prefix, and a nod to the C programming lint program. It follows the style recommended by PEP 8, the Python style guide.

What is Pylint and how do you use it?

What is Pylint? It is a static code analysis tool to identify errors in Python code and helps programmers enforce good coding style. This tool enables them debugging complex code with less manual work. It is one of the tools which gets used for test-driven development (TDD).


1 Answers

I found it in the source code (Pylint version 2.6.0):

"I1101": (
    "%s %r has no %r member%s, but source is unavailable. Consider "
    "adding this module to extension-pkg-whitelist if you want "
    "to perform analysis based on run-time introspection of living objects.",
    "c-extension-no-member",
    "Used when a variable is accessed for non-existent member of C "
    "extension. Due to unavailability of source static analysis is impossible, "
    "but it may be performed by introspecting living objects in run-time.",

And also a list of the error codes here including the "I".

As for what I means:

  1. if you can reproduce the message then i suggest generating Pylint reports then prints a list with all the error categories of your result. Hopefully the I category too. To enable reports, when you run Pylint simply add the flag -rn or --reports=y

  2. This documentation might help you understand more, so you could just disable this error if you wish to.

like image 150
Or b Avatar answered Oct 21 '22 07:10

Or b