Skip to content

Return the FunctionDef node when a call is made to a decorated function.#2965

Draft
mbyrnepr2 wants to merge 2 commits into
pylint-dev:mainfrom
mbyrnepr2:pylint_10848_called_decorated_fn_fp
Draft

Return the FunctionDef node when a call is made to a decorated function.#2965
mbyrnepr2 wants to merge 2 commits into
pylint-dev:mainfrom
mbyrnepr2:pylint_10848_called_decorated_fn_fp

Conversation

@mbyrnepr2
Copy link
Copy Markdown
Member

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
📜 Docs

Description

Return the FunctionDef node when a call is made to a decorated function.

instead of returning the inferred FunctionDef node. This prevents no-member messages in Pylint when a decorated function is called and then is missing expected attributes; Pylint recognizes when a FunctionDef node has any decorators and suppresses the message (https://github.com/pylint-dev/pylint/blob/main/pylint/checkers/typecheck.py#L1133-L1139)

Closes pylint-dev/pylint#10848

mbyrnepr2 and others added 2 commits February 16, 2026 12:00
…nction

instead of returning the inferred ``FunctionDef`` node.
This prevents ``no-member`` messages in Pylint when a decorated function is
called and then is missing expected attributes; Pylint recognizes when a
``FunctionDef`` node has any decorators and suppresses the message.

Closes pylint-dev/pylint#10848
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pylint does not honor decorator return type when using @ syntax

1 participant