-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
CheckersRelated to a checkerRelated to a checkerEnhancement ✨Improvement to a componentImprovement to a componentGood first issueFriendly and approachable by new contributorsFriendly and approachable by new contributorsHelp wanted 🙏Outside help would be appreciated, good for new contributorsOutside help would be appreciated, good for new contributors
Description
class fruit:
def _do_actions(self, fruit_name: str):
pass
class orange(fruit):
def _do_actions(self, orange_name: str): # will trigger arguments-differ
passI think we should differentiate errors:
arguments-differif something changed except the names (i.e., number of args, their types, or args become kwargs, or so.).- a new error:
arguments-renamedshould be raised only if a name was changed.
But arguments changed in a way that old arguments change their positions (i.e. swapped) arguments-differ should be raise anyway:
class fruit:
def xxx(self, a: str, b: str):
pass
class orange(fruit):
def xxx(self, b: str, a:str): # MUST trigger arguments-differ
passRationale:
If I just add # pylint: disable=arguments-differ it would hide other arguments-related errors in this line. As a workaround I can write something like:
class orange(fruit):
def _do_actions(self, fruit_name: str): # will trigger arguments-differ
super()._do_actions(fruit_name)
orange_name = fruit_name
# use orange_name in the code.but this is slightly stupid. I would not like to do such a trick just to silence the linter.
Metadata
Metadata
Assignees
Labels
CheckersRelated to a checkerRelated to a checkerEnhancement ✨Improvement to a componentImprovement to a componentGood first issueFriendly and approachable by new contributorsFriendly and approachable by new contributorsHelp wanted 🙏Outside help would be appreciated, good for new contributorsOutside help would be appreciated, good for new contributors