Skip to content

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!

@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
@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