0

Three tiny Python 3 files are required:

  1. Empty __init__.py

  2. main.py with one line: config = "data"

  3. sub.py with one line: import main; print(main.config)

python3 sub.py (and also python2) prints the word data as expected, but pylint warns when checking sub.py:

E: 1,20: Module 'main' has no 'config' member (no-member)

I have no explanation for it.

VPfB
  • 14,927
  • 6
  • 41
  • 75

1 Answers1

0

pylint doesn't load any C extensions by default, because those can run arbitrary code.

method: create a new file named .pylintrcin your project root dir and paste this:

extension-pkg-whitelist=PyQt5

then it will work.

Reference: http://pylint.pycqa.org/en/latest/technical_reference/c_extensions.html

Related Question on SO

Adrian W
  • 4,563
  • 11
  • 38
  • 52
Kevin
  • 1