You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background: when using partial from functools (which is a default function from Python3) multiple times in a chain, pylint doesn't recognise the previous defined value(s) for the current argument(s).
Steps to reproduce
Make a new file animal.py
""" False positive demo for no-value-for-parameter """
from functools import partial
def animal(name, type_, legs):
""" Prints 'name' is a 'type_' with 'legs' legs
"""
print(f'{name} is a {type_} with {legs} legs')
MAMMAL = partial(animal, type_='mammal')
DOG = partial(MAMMAL, legs=4)
if __name__ == "__main__":
DOG('Jake')
Jake is a mammal with 4 legs
Run pylint animal.py
Current behavior
************* Module animal
animal.py:13:4: E1120: No value for argument 'type_' in function call (no-value-for-parameter)
Your code has been rated at 2.86/10 (previous run: 1.43/10, +1.43)
Background: when using partial from functools (which is a default function from Python3) multiple times in a chain, pylint doesn't recognise the previous defined value(s) for the current argument(s).
Steps to reproduce
animal.py
pylint animal.py
Current behavior
Expected behavior
The code should be rated at 10/10
pylint --version output
The text was updated successfully, but these errors were encountered: