Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 pylint question
#1
Hi, everyone. Here's my short snippet of code:

""" Module docstring goes here """

class Robot():
    """ Class docstring goes here """

    def __init__(self, x_axis=0, y_axis=0):
        """ Function/method docstring goes here """
        self.x_axis = x_axis
        self.y_axis = y_axis

    def move_robot(self, x_increment=1, y_increment=1):
        """ Function/method docstring goes here """
        self.x_axis += x_increment
        self.y_axis += y_increment

robot01 = Robot(4, 7)
print('\nrobot01 x,y =', robot01.x_axis, robot01.y_axis)
It runs fine. However, when I run it through pylint, it gives it a score of 7.78/10 for two reasons I don't understand:

Quote:pylint testrobot.py
************* Module testrobot
testrobot.py:3:0: R0903: Too few public methods (1/2) (too-few-public-methods)
testrobot.py:16:0: C0103: Constant name "robot01" doesn't conform to UPPER_CASE naming style (invalid-name)

1. What does it mean "too few public methods"?

2. Why should robot01 be in UPPER_CASE naming style?

Thanks for your help!
David
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Pylint/pyflakes/flake8 missed AttributeError elyoni 2 104 Feb-19-2020, 07:36 AM
Last Post: elyoni
  Pylint Statment Count Shangeetha 1 140 Dec-22-2019, 04:58 PM
Last Post: Larz60+
  pylint & #! pileofrogs 1 369 May-23-2019, 01:58 PM
Last Post: heiner55
  redefinition of a method in a class: pylint warning kboo 1 1,258 Feb-13-2018, 11:21 AM
Last Post: buran

Forum Jump:


Users browsing this thread: 1 Guest(s)