[Python-projects] Expected behaviour of W403: relative import?

Toshio Kuratomi a.badger at gmail.com
Sun Jun 15 14:28:51 CEST 2008


:python: 2.5.1
:pylint: 0.14.0
:logilab-common: 0.28.0
:logilab-astng: 0.17.2

Hi, I have the following hierachy in my package::

   fedora/
     __init__.py
     client/
       __init__.py
       baseclient.py
         class BaseClient(object)
       pkgdb.py
         class PackageDB(BaseClient)

in pkgdb.py, I need to import BaseClient.

At first I used::
   from baseclient import BaseClient

running pylint gave me::
   W0403: 27: Relative import 'baseclient'

Good!  But when I tried to fix it::
   from .baseclient import BaseClient

I still receive W0403.  Is this expected behaviour?  I want to catch 
relative imports that are ambiguous but I thought that the "." syntax 
was created to remove the ambiguity.

Thanks,
-Toshio

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
Url : http://lists.logilab.org/pipermail/python-projects/attachments/20080615/263720f3/attachment.pgp 


More information about the Python-Projects mailing list