Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pychecker and "import my.special.module as mymod"

1 view
Skip to first unread message

News123

unread,
Feb 3, 2010, 7:18:31 PM2/3/10
to
Hi,

I'm not really used to structuring modules withn directories, but I
started playing


#####################################
# the commands to reproduce my setup:
#####################################
mkdir -p my/special
touch my/__init__.py my/special/__init__.py
echo 'print "myspecialmod"' > my/special/module.py
echo "import my.special.module as mymod" > tst.py

so I have now following files:
-rw-r--r-- 1 0 2010-02-04 01:05 ./my/__init__.py
-rw-r--r-- 1 131 2010-02-04 01:07 ./my/__init__.pyc
-rw-r--r-- 1 0 2010-02-04 01:05 ./my/special/__init__.py
-rw-r--r-- 1 139 2010-02-04 01:07 ./my/special/__init__.pyc
-rw-r--r-- 1 21 2010-02-04 01:06 ./my/special/module.py
-rw-r--r-- 1 159 2010-02-04 01:07 ./my/special/module.pyc
-rw-r--r-- 1 34 2010-02-04 01:07 ./tst.py

the program tst.py runs as expected:
> $ python tst.py
> myspecialmod

However pychecker gives me two warnings:
> $ pychecker tst.py
> Processing module tst (tst.py)...
> myspecialmod
>
> Warnings...
>
> tst.py:1: Imported module (my.special.module) not used
> tst.py:1: No module attribute (special) found

I understand the first one and this one will not appear in my real code.
However I don't really understand the second one.

So my questions are:
- Is this a real warning or is this 'just' a pychecker problem?
- Can I write my code such, that the warning will not appear?
- Is there a pychecker switch, which would get rid of this warning?


thanks a lot in advance for your answers / suggestions

N


0 new messages