-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix arguments-differ<W0221>
linter errors.
#1993
Fix arguments-differ<W0221>
linter errors.
#1993
Conversation
@@ -34,7 +34,7 @@ def is_dhcp_enabled(self): | |||
def get_dhcp_pid(self): | |||
return self._get_dhcp_pid(["pidof", "dhcpcd"]) | |||
|
|||
def restart_if(self, ifname): # pylint: disable=W0221 | |||
def restart_if(self, ifname, unused_retries=None, unused_wait=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should keep the parameter names consistent, too, in case somebody ever does "restart_if(..., retries=...)
# the original (and, by forwarding the kwargs to the original, will reject any | ||
# option _not_ accepted by the original). Additionally, this method allows us | ||
# to keep the defaults for mount_dvd in one place (the original function) instead | ||
# of having to duplicate it here as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But with this signature this function will accept arguments the base function doesn't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort of; this function basically immediately passes the kwargs
to its super, which would then error out on invalid input.
I realize that that doesn't completely localize the error to this function, though; I felt like this was better than repeating the defaults here as well, and having to keep both up to date. Maybe this isn't the case, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok as is, thanks
44f645e
to
45f3e99
Compare
7bfbf3f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -34,7 +34,7 @@ def is_dhcp_enabled(self): | |||
def get_dhcp_pid(self): | |||
return self._get_dhcp_pid(["pidof", "dhcpcd"]) | |||
|
|||
def restart_if(self, ifname): # pylint: disable=W0221 | |||
def restart_if(self, ifname, retries=None, wait=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised pylint is not complaining about unused variables now lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also confused with this, lol. My understanding is that pylint is smart enough to realize that these parameters are used in the base classes' method, that this method is overriding.
Description
PR information
Quality of Code and Contribution Guidelines