lint

How to type annotate reduce function?

How to type annotate reduce function? Question: I’m writing a very thin wrapper on top of list and I want to define a method called reduce, but I’m struggling to annotate it properly such that pylance, mypy & pylint cut their complaints whenever I use the method, or even define it. I was perturbed to …

Total answers: 1

Can't fully disable python linting Pylance VSCODE

Can't fully disable python linting Pylance VSCODE Question: I’ve been searching online for quite a while now and can’t seem to find a solution for my problem. I installed Pylance (the newest Microsoft interpreter for Python) and can’t seem to disable linting at all. I’ve tried a lot of options but none worked. Here’s a …

Total answers: 3

Pylint not running as expected in VScode

Pylint not running as expected in VScode Question: When I am running via shell a pylint: $ pylint decorator.py No config file found, using default configuration ************* Module decorator C: 7, 0: Unnecessary parens after ‘print’ keyword (superfluous-parens) C: 15, 0: Unnecessary parens after ‘print’ keyword (superfluous-parens) C: 1, 0: Missing module docstring (missing-docstring) C: …

Total answers: 3

SyntaxError: unexpected EOF while parsing

Why does the IPython REPL tell me "SyntaxError: unexpected EOF while parsing" as I input the code? Question: I’m getting an error while running this part of the code. I tried some of the existing solutions, but none of them helped. elec_and_weather = pd.read_csv(r’C:HOUR.csv’, parse_dates=True,index_col=0) # Add historic DEMAND to each X vector for i …

Total answers: 9

How to ignore Pyflakes errors ‘imported but unused’ in the ‘__init__.py’ file?

How to ignore Pyflakes errors ‘imported but unused’ in ‘__init__.py’ files? Question: I split my tests across multiple Python files: tests ├── __init__.py ├── test_apples.py └── test_bananas.py.py I import the tests in the ‘__init__.py’ file: from test_apples import ApplesTest from test_bananas import BananasTest However running Pyflakes on the command-line: pyflakes . outputs the following errors: …

Total answers: 6