1

I'm using __package__ in setup.py to refer to the top-level name of the package it's supposed to test, build, install, etc.. However, pylint objects:

Module 'mian.mian' has no '__package__' member 

This works fine in ipython:

from mian import mian as package package.__dict__ ... '__package__': 'mian', 

Is pylint doing the right thing here, ignoring PEP 366's "When the import system encounters an explicit relative import in a module without __package__ set (or with it set to None), it will calculate and store the correct value"? If so, what do I need to change?

Workaround: Use package.__name__.rpartition('.')[0] instead of package.__package__.

2
  • 1
    If you're really trying to fix everything that pylint complains about, you'd have an awful lot of work for nothing. And your program will only get worse. But you might file a bug report. Commented Feb 12, 2011 at 17:45
  • which version of pylint are you using (hint: include the output of pylint --version) Commented Apr 4, 2011 at 9:24

1 Answer 1

2

This is now a ticket on Pylint's tracker: http://www.logilab.org/ticket/73668

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.