pylint
pylint copied to clipboard
It's not just a linter that annoys you!
### Bug description With the minimal code shown below, I get error W0612, unused variable _HAS_DEFAULT_FACTORY at line 1 column 1, the start of the code. The module docstring is...
### Bug description ```python `pyright` uses `...` to determine the body of this method is not implemented here. Without using `...`, `pyright` rightfully (IMHO, as is the only way it...
### Bug description ```python import openai client = openai.OpenAI() with open('test.txt', 'r', encoding='utf-8') as handle: contents = handle.read() completion = client.chat.completions.create( model="gpt-4-1106-preview", messages = [ { "role":"user", "content": "Summarize\n\n" +...
### Bug description Following: ```py import psycopg with psycopg.connect('...') as conn: pass ``` ...raises E1129 (not-context-manager) violation. But the code works fine and sources look ok as [psycopg.connect()](https://github.com/psycopg/psycopg/blob/master/psycopg/psycopg/connection.py#L522-L556) returns [Connection](https://github.com/psycopg/psycopg/blob/master/psycopg/psycopg/connection.py#L502)...
When parsing the following ``.py`` file: https://github.com/sarzamas/pytest_rest_example_pets/blob/main/tests/pet/conftest.py ### OS / Environment GitHub Actions for this public project Runner - latest (Windows) ### Command used ```shell pylint $(git ls-files '*.py') ```...
https://github.com/pylint-dev/pylint/blob/278de0f43e389142d14d2ba2a47b770c2d84a085/doc/data/messages/u/unnecessary-lambda/good/pandas.py#L1C7-L1C7 Turns out this doesn't seem to be valid, because python interprets `str` in `df.apply(str)` as a type instead of a method. At least this is the case in 3.10+
### Bug description I run pylint on a repo that is mounted via SSHFS, which leads to slow I/O speeds. While profiling a run, I noticed that the `import-error` checks...
### Bug description ```python import torch test = torch.nn.Parameter(torch.rand(2, 10, 1, 3)) test = test.repeat(1, 1, 3, 1)[:, :, 0, :] ``` ### Configuration _No response_ ### Command used ```shell...
### Bug description ```python """This shows missing W4701""" import glob files = glob.glob("$VALID_PATH_GLOB") # this explicitly types return to list for _f in files: # infinite loop not triggering W4701...
### Bug description The `too-many-statements` error can't be disabled in **Line 27**, though this error is disabled in whole file and inline. This error is correctly suppressed in **Line 35**....