Mar-26-2020, 08:49 PM
Hi, everyone. Here's my short snippet of code:
1. What does it mean "too few public methods"?
2. Why should robot01 be in UPPER_CASE naming style?
Thanks for your help!
David
""" 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
