Skip to content

CONTRIBUTING: Add @deprecated, other updates - #11005

Merged
JelleZijlstra merged 3 commits into
python:mainfrom
JelleZijlstra:deprdocs
Nov 18, 2023
Merged

CONTRIBUTING: Add @deprecated, other updates#11005
JelleZijlstra merged 3 commits into
python:mainfrom
JelleZijlstra:deprdocs

Conversation

@JelleZijlstra

@JelleZijlstraJelleZijlstra commented Nov 10, 2023

Copy link
Copy Markdown
Member

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

Fixespython#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
Comment threadCONTRIBUTING.md

A few guidelines for how to use it:

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

@hauntsaninjahauntsaninjaNov 10, 2023

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
MemberAuthor

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.

@srittausrittau left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
MemberAuthor

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

@AlexWaygoodAlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is great, thanks!

Comment threadCONTRIBUTING.md Outdated
@AlexWaygood

Copy link
Copy Markdown
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:mainNov 18, 2023
@JelleZijlstra
JelleZijlstra deleted the deprdocs branch November 18, 2023 20:55
@JelleZijlstra

Copy link
Copy Markdown
MemberAuthor

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

Sign up for freeto 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

@JelleZijlstra@AlexWaygood@srittau@hauntsaninja