Questions tagged [pylint]

Pylint is a Python source code analyzer looking for bugs and signs of poor quality.

Pylint is a Python tool that checks if a module satisfies a coding standard.

1691 questions
0
votes
0 answers

how to i debug unable to import 'adoptions.models'?

The error says Unable to import 'adoptions.models' and No value for argument 'dt' in unbound method call. Program: from csv import DictReader from datetime import datetime from django.core.management import BaseCommand from adoptions.models import…
0
votes
1 answer

What type of exception should I use to avoid No exception type(s) specified

I have a list with these values ['apple', 'banana', '10', 'oranges'] I want to iterate every element in the list and try to convert it into an int. this is my code so far lst = ['apple', 'banana', '10', 'oranges'] for i in lst: try: …
Sashaank
  • 880
  • 2
  • 20
  • 54
0
votes
1 answer

how to configure pylint for greater accuracy

Getting false positive from pylint Consider this code: previous = None for word in ['you', 'cannot', 'be', 'serious']: if previous is not None: print(previous[0], word) previous = word Here is the output (no surprises here): $…
alani
  • 12,573
  • 2
  • 13
  • 23
0
votes
1 answer

How can I get flake8 to catch this error?

On this test program: def func(): return 42 func(1, 2, 3) pylint -E it says: E1121: Too many positional arguments for function call (too-many-function-args) But flake8 says no errors or warnings. This is a huge obvious error why does flake8…
Philip
  • 1,691
  • 4
  • 21
  • 41
0
votes
1 answer

pylint shows import-error with directories inside the working directory

After installing a new version of Python(from 3.8.1 to 3.8.3) and using it with Visual Studio Code, I've encountered an issue with pylint that did not happen prior the upgrade. My working directory tree is as follows: bot ┣ cogs ┃ ┗ cog.py ┣…
Daniel
  • 375
  • 3
  • 17
0
votes
2 answers

Pylint doesn't recognize my Python imports on VS Code, but the code runs without any error

I'm working on Windows 7 64bits with Anaconda 3. On my environment Nifti, I have installed Tensorflow 2.1.0, Keras 2.3.1 and Python 3.7.7. On Visual Studio Code there is a problem with all of these imports: from tensorflow.python.keras.models import…
VansFannel
  • 45,055
  • 107
  • 359
  • 626
0
votes
0 answers

I am trying to fix this pylint warning message

I am trying to install pylint and keep getting this error. Here the error message : WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(, 'Connection to…
0
votes
1 answer

Python Error :Inheriting 'X', which is not a class

I have written the code using Visual Studio code from datetime import date Title = 'Actividad #$' Complexity = 0 Time = 5 #cantidad en dias class Activitie(Title,Complexity,Time): """Log your activity with this class""" Title = 'Actividad…
Dr.Omar
  • 5
  • 1
  • 3
0
votes
1 answer

How to add pylint for Django in vscode manually?

I have created a Django project in vscode. Generally, vscode automatically prompts me to install pylint but this time it did not (or i missed it). Even though everything is running smoothly, I am still shown import errors. How do I manually install…
iscream
  • 680
  • 2
  • 8
  • 20
0
votes
1 answer

how to let pre-commit only check the python codes you changed, not the whole file

I used pre-commit to check my python code style before I commit to git. It works very well. But now I am working on an old project, most of my work just modify several lines of the file. But pre-commit always ask me fix all the pep8 issues of the…
Gary Wang
  • 81
  • 1
  • 1
  • 4
0
votes
1 answer

Pylint false positive ": wrapped C/C++ object of type QApplication has been deleted"

I have been using my coding environment for a while. This issue happens recently after some upgrades of the pylint or VS-code. My setup is: VS-Code + Python 3.7(anaconda) + pylint 2.5.0 some extensions I'm using with VS-Code are: Anaconda Extension…
YKU
  • 1
  • 2
0
votes
1 answer

What path does vscode use when installing packages?

(First question on here.) I'm using vscode on Windows to program in python. My Windows username has spaces in it and so I have to use double quotes in most paths, and have changed my pythonPath and fileName path accordingly. But when I'm prompted…
sanvarma
  • 1
  • 2
0
votes
2 answers

Pylint error when inheriting from List[type]

I wrote the following piece of code: from typing import List class Foo(): def __init__(self, _a : int, _b : bool): self.a = _a self.b = _b class Bar(List[Foo]): def print(self): for entry in self: # Non-iterable…
0
votes
2 answers

How can I break a line of very long nested dictionaries?

if details['box'] == {} or details['box'][last_box_key].get('timeout', datetime.min) < datetime.now(): I tried putting brackets around the dict but I cant seem to break this really long line.
user13191962
0
votes
1 answer

Unable to see a detailed report running pylint in mac terminal

I do have pylint installed to the latest version, however when running pylint myfile.py -r nothing is executed as shown in the screenshot attached. you can see that I have pylint installed If anyone can help me to locate an issue here, thanks in…