pylint

Pylint: func.max is not callable

Pylint: func.max is not callable Question: In my python code, I import func… from sqlalchemy.sql.expression import func Then, during my code I select data from a database table… select(func.max(MyTable.my_datetime)) …where my_datetime is a DateTime data type… from sqlalchemy.types import DateTime my_datetime = Column(‘my_datetime’, DateTime) The code runs OK, but in the vscode editor I am …

Total answers: 1

Possible unbalanced tuple unpacking with sequence in scipy optimization curve_fit

Possible unbalanced tuple unpacking with sequence in scipy optimization curve_fit Question: I got error from pylint from my code. I don’t know how to fix that. can you please help me? The code is here: import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit # Define the two points x1, y1 = …

Total answers: 2

Parse PyLint output using Python script

Parse PyLint output using Python script Question: I am trying to write a simple pylint parser that, given a python project, extracts the information on code smells, class names, and scores. In particular, the script must analyze each python file and generate a data frame with the previously indicated information (code smells, project name, and …

Total answers: 1

Pylint: Specifying exception names in the overgeneral-exceptions option without module name is deprecated

Pylint: Specifying exception names in the overgeneral-exceptions option without module name is deprecated Question: pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe ‘builtins.BaseException’ ?) instead. Getting PyLint error. I …

Total answers: 1

Pylint giving false errors on Django project

Pylint giving false errors on Django project Question: I’m using VSCode and the Pylint that ships with it, i.e., no extension. Everything has been running smooth for many months and I’ve never had an issue with Pylint presenting weird alerts. I recently started learning Django and today when following the official Django Documentation tutorial part …

Total answers: 2

Why does pylint raises this error: Parsing failed: 'cannot assign to expression here. Maybe you meant '==' instead of '='?

Why does pylint raises this error: Parsing failed: 'cannot assign to expression here. Maybe you meant '==' instead of '='? Question: While solving some exercises from the "Impractical Python Projects" book I’ve encountered this error: myconfig.pylintrc:6:1: E0001: Parsing failed: ‘cannot assign to expression here. Maybe you meant ‘==’ instead of ‘=’? (<unknown>, line 6)’ (syntax-error) …

Total answers: 1

Pylint redundant comparison for NaN

Pylint redundant comparison for NaN Question: Why does Pylint think this is a redundant comparison? Is this not the fastest way to check for NaN? Refactor: R0124 Redundant comparison – value_1 != value_1 Redundant comparison – value_2 != value_2 How else am I supposed to check if two values are equal including when they’re nan? …

Total answers: 2

Pylint ignore rules on git action

Pylint ignore rules on git action Question: I’ve used the default pylint from git actions to check my project for any errors. There are some errors that I want to ignore though. If it was in vscode you could ignore them in settings.json. How do I ignore them in git actions? name: Pylint on: [push] …

Total answers: 1

What's pylint's TypeVar name specification?

What's pylint's TypeVar name specification? Question: Pylint gives a warning whenever something like this happens: import typing SEQ_FR = typing.TypeVar("SEQ_FR") #^^^^^ gets underlined with the warning The warning is like this: Type variable name "SEQ_FR" doesn’t conform to predefined naming style. pylint(invalid-name) I tried searching through Pylint’s documentations with no luck on finding the exact …

Total answers: 1

Singleton-comparison suggestion by pylint

Singleton-comparison suggestion by pylint Question: For the given code def greater(n): if n > 3: res = True else: res = False return res a = greater(5) print(hex(id(a))) print(hex(id(True))) b = True print(hex(id(b))) if a == True: print(‘yes’) else: print(‘no’) pylint suggests pylint_example.py:16:4: C0121: Comparison ‘a == True’ should be ‘a is True’ if checking …

Total answers: 2