pylint icon indicating copy to clipboard operation
pylint copied to clipboard

`not-callable` false positive for `types.FunctionType`

Open Jackenmen opened this issue 1 year ago • 0 comments

Bug description

# pylint: disable=missing-docstring

import types

code = compile(input(">>> "), "<stdin>", "exec")
types.FunctionType(code, {})()

A more complete example of public code constructing types.FunctionCode object can be found at: https://github.com/python/cpython/blob/34de67c094776bdc719d87f8810e053a2acc915a/Lib/asyncio/main.py#L32

Configuration

No response

Command used

pylint repro.py

Pylint output

************* Module repro
repro.py:6:0: E1102: types.FunctionType(code, {}) is not callable (not-callable)

------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)

Expected behavior

No error.

Pylint version

pylint 2.15.3
astroid 2.12.10
Python 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0]

OS / Environment

Kubuntu 22.04.1 LTS

Additional dependencies

No response

Jackenmen avatar Sep 20 '22 01:09 Jackenmen