Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Warning in python file when i m using pychecker.

Reply
Thread Tools

Warning in python file when i m using pychecker.

 
 
Avnesh Shakya
Guest
Posts: n/a
 
      04-26-2013
hi,
I am trying to run my file using pychecker, but it's showing warning. I am unable to get these warning. Please help me, how to remove these warning. I am using pychecker first time.

avin@HP:~/github/UdacitySiteData$ pychecker udacity_to_jsonFinal.py
Processing module udacity_to_jsonFinal (udacity_to_jsonFinal.py)...

Warnings...

[system path]/dist-packages/bs4/__init__.py:206: Parameter (successor) not used
[system path]/dist-packages/bs4/__init__.py:209: Parameter (successor) not used
[system path]/dist-packages/bs4/__init__.py:213: Local variable (tag) not used

[system path]/dist-packages/bs4/element.py:306: Parameter (kwargs) not used
[system path]/dist-packages/bs4/element.py:507: (id) shadows builtin
[system path]/dist-packages/bs4/element.py:791: (next) shadows builtin
[system path]/dist-packages/bs4/element.py:903: Invalid arguments to (__repr__), got 2, expected 1

Thanks.
 
Reply With Quote
 
 
 
 
Fábio Santos
Guest
Posts: n/a
 
      04-26-2013
Read the warnings carefully. They are pretty clear.
On 26 Apr 2013 07:48, "Avnesh Shakya" <(E-Mail Removed)> wrote:

> hi,
> I am trying to run my file using pychecker, but it's showing warning. I
> am unable to get these warning. Please help me, how to remove these
> warning. I am using pychecker first time.
>
> avin@HP:~/github/UdacitySiteData$ pychecker udacity_to_jsonFinal.py
> Processing module udacity_to_jsonFinal (udacity_to_jsonFinal.py)...
>
> Warnings...
>
> [system path]/dist-packages/bs4/__init__.py:206: Parameter (successor) not
> used
> [system path]/dist-packages/bs4/__init__.py:209: Parameter (successor) not
> used
> [system path]/dist-packages/bs4/__init__.py:213: Local variable (tag) not
> used
>
> [system path]/dist-packages/bs4/element.py:306: Parameter (kwargs) not used
> [system path]/dist-packages/bs4/element.py:507: (id) shadows builtin
> [system path]/dist-packages/bs4/element.py:791: (next) shadows builtin
> [system path]/dist-packages/bs4/element.py:903: Invalid arguments to
> (__repr__), got 2, expected 1
>
> Thanks.
> --
> http://mail.python.org/mailman/listinfo/python-list
>


 
Reply With Quote
 
 
 
 
Dave Angel
Guest
Posts: n/a
 
      04-26-2013
On 04/26/2013 02:42 AM, Avnesh Shakya wrote:
> hi,
> I am trying to run my file using pychecker, but it's showing warning. I am unable to get these warning. Please help me, how to remove these warning. I am using pychecker first time.
>
> avin@HP:~/github/UdacitySiteData$ pychecker udacity_to_jsonFinal.py
> Processing module udacity_to_jsonFinal (udacity_to_jsonFinal.py)...
>
> Warnings...
>
> [system path]/dist-packages/bs4/__init__.py:206: Parameter (successor) not used
> [system path]/dist-packages/bs4/__init__.py:209: Parameter (successor) not used
> [system path]/dist-packages/bs4/__init__.py:213: Local variable (tag) not used
>
> [system path]/dist-packages/bs4/element.py:306: Parameter (kwargs) not used
> [system path]/dist-packages/bs4/element.py:507: (id) shadows builtin
> [system path]/dist-packages/bs4/element.py:791: (next) shadows builtin
> [system path]/dist-packages/bs4/element.py:903: Invalid arguments to (__repr__), got 2, expected 1
>
> Thanks.
>


What's not clear about any of these? On line 206, you defined some
function and one of the formal parameters was called successor. You
don't use that value anywhere in the function. The fix? Omit the
unused parameter in the function definition, and change all the caller
sites. Sometimes this is impractical, for example in functions that are
callbacks from code you don't control.

Likewise for the next 3.

id() is a built-in function, so you shouldn't use that name for your own
functions or variables. rename it.

Likewise next, which is even more likely to cause confusion, since next
is frequently used in real code, while id() is more likely a debugging aid.

If you want anything more detailed, perhaps you should show the context
around each warning. You have the line numbers, so that should be easy.


--
DaveA
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
when I read gzipped response from web-servers, GzipReader returnssometimes 'invalid compressed data -- crc error' henry.jykim@gmail.com Ruby 0 04-08-2013 03:51 PM
WARNING! Prosoftstore.com is a SCAM! WARNING! pentologer@gmail.com ASP .Net Web Services 0 07-08-2007 10:03 AM
warning C4267 and warning C4996 B. Williams C++ 17 10-27-2006 09:41 PM
Warning: WARNING Charles Computer Support 7 08-16-2005 09:07 PM
Re: A code fix for MSVC warning C4267 (64-bit compatibility warning,e.g. Boost Spirit) Pete Becker C++ 0 02-10-2005 01:13 PM



Advertisments