Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PEP 702 (@deprecated) #16111

Closed
llucax opened this issue Sep 14, 2023 · 4 comments · Fixed by #17476
Closed

Add support for PEP 702 (@deprecated) #16111

llucax opened this issue Sep 14, 2023 · 4 comments · Fixed by #17476
Labels
feature topic-pep-702 PEP 702, @deprecated

Comments

@llucax
Copy link

llucax commented Sep 14, 2023

Feature

Report where @deprecated symbols are used in the code.

Pitch

Python 3.12 is coming soon, and it introduces PEP 702 (the @deprecated decorator).mypy should support it.

@llucax llucax added the feature label Sep 14, 2023
@hauntsaninja
Copy link
Collaborator

(Technically PEP 702 will not be in Python 3.12, the PEP has not been accepted. But yes, mypy should support the draft standard and its use via typing_extensions)

@Bendabir
Copy link

Bendabir commented Mar 16, 2024

If some people are interested, I wrote a small plugin to support this until it's part of mypy directly : https://github.com/Bendabir/mypypp

I don't really know the internals so it's probably a bit hacky but it appears to work.

@EwoutH
Copy link

EwoutH commented Aug 17, 2024

If I'm correct, this issue is required for Python 3.13 support right? What's needed to move it forward?

@hauntsaninja
Copy link
Collaborator

You could make a PR that incorporates this feedback: #17476 (review)

ilevkivskyi added a commit that referenced this issue Oct 6, 2024
Closes #16111

This PR provides only basic support. Many special cases might need
additional attention (descriptors, some special methods like `__int__`,
etc.). Other open issues are code comments, eventual documentation
updates, the deprecation message style, etc.). But I wanted to offer
these first steps before going on vacation (so I cannot respond to
possible reviews too soon).

Maybe someone wants to extend the list of (test) cases the basic support
should address?

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ivan Levkivskyi <[email protected]>
@JelleZijlstra JelleZijlstra added the topic-pep-702 PEP 702, @deprecated label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature topic-pep-702 PEP 702, @deprecated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants