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

CONTRIBUTING: Add @deprecated, other updates #11005

Merged
merged 3 commits into from
Nov 18, 2023

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Nov 10, 2023

Fixes #11002.

I started out just documenting conventions with @deprecated, but
found some other things in need of updates.

  • PEP 585 and 612 are now fully supported
  • Add several other PEPs that we fully support
  • Use updated links to PEPs
  • Split off a few sections from the long "Conventions" section
  • PEP 688 was accepted

Fixes python#11004.

I started out just documenting conventions with `@deprecated`, but
found some other things in need of updates.

- PEP 585 and 612 are now fully supported
- Add several other PEPs that we fully support
- Use updated links to PEPs
- Split off a few sections from the long "Conventions" section
- PEP 688 was accepted

A few guidelines for how to use it:

* In the standard library, apply the decorator only in Python versions
Copy link
Collaborator

@hauntsaninja hauntsaninja Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented in the issue, but I think it would be nice to be more aggressive in cases where an appropriate replacement already exists. (I couldn't quite tell if there was consensus in the issue, if there was then that's fine!)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree now, reworded the section to say we should apply it to versions where a good replacement exists.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header "The following features are partially supported:" could be removed, since the list was removed.

@JelleZijlstra
Copy link
Member Author

@srittau I'm actually going to move PEP 702 into that section as there are some bugs that mean we can't use it in certain contexts yet.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks!

CONTRIBUTING.md Outdated Show resolved Hide resolved
@AlexWaygood
Copy link
Member

I'm guessing pytype just doesn't like have two decorators stacked anywhere in a stub. I'm guessing it also crashes if you try to deprecate an abstractmethod

@JelleZijlstra JelleZijlstra merged commit 5fd2e9b into python:main Nov 18, 2023
1 check passed
@JelleZijlstra JelleZijlstra deleted the deprdocs branch November 18, 2023 20:55
@JelleZijlstra
Copy link
Member Author

Probably, I guess it's not worth listing exactly which decorators are problematic.

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.

How should we add @deprecated to objects in the standard library?
4 participants