Warning in python file when i m using pychecker.

Discussion in 'Python' started by Avnesh Shakya, Apr 26, 2013.

  1. 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.
     
    Avnesh Shakya, Apr 26, 2013
    #1
    1. Advertising

  2. Read the warnings carefully. They are pretty clear.
    On 26 Apr 2013 07:48, "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.
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
     
    Fábio Santos, Apr 26, 2013
    #2
    1. Advertising

  3. Avnesh Shakya

    Dave Angel Guest

    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
     
    Dave Angel, Apr 26, 2013
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    16
    Views:
    548
  2. Tim Peters

    RE: PyChecker work with Python 2.3?

    Tim Peters, Aug 3, 2003, in forum: Python
    Replies:
    1
    Views:
    362
    John Machin
    Aug 4, 2003
  3. Pedro Werneck
    Replies:
    0
    Views:
    467
    Pedro Werneck
    Aug 18, 2003
  4. Pekka Niiranen
    Replies:
    2
    Views:
    525
    Josiah Carlson
    Oct 15, 2004
  5. Leo Breebaart

    What does this PyChecker warning mean?

    Leo Breebaart, Jun 1, 2010, in forum: Python
    Replies:
    5
    Views:
    319
    MrJean1
    Jun 1, 2010
Loading...

Share This Page