Skip to content

reused deprecated decorator instance does not work #5747

Todo

Description

@DetachHead

Describe the Bug

from warnings import deprecated

foo = deprecated("asdf")

@foo
def fn() -> None: ...


fn() # no error

this is a common pattern in my codebase when many functions/classes are deprecated for the same reason, to avoid having to duplicate the message multiple times.

this works in both ty and pyright

probably related: #5693

Sandbox Link

https://pyrefly.org/sandbox/?project=v2.w1tkgiwDFgiIPJ9aAHRxItDtkGjIBzoJIaYRo5RYnJIWowSOJAegNDQ9I6cDBT09PZA0UDtIWFkhLx8S3FiCsyi1OLUE7Gtg0Mfg9wcA

(Only applicable for extension issues) IDE Information

No response

Activity

  1. self-assigned this
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions