l0b0
l0b0

Reputation: 58808

pylint balks on reference to __package__

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__.

Upvotes: 1

Views: 304

Answers (1)

gurney alex
gurney alex

Reputation: 13645

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

Upvotes: 2

Related Questions