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 Doc from PEP 727: https://peps.python.org/pep-0727/ #277

Merged
merged 18 commits into from Sep 8, 2023

Conversation

tiangolo
Copy link
Sponsor Contributor

Add doc and DocInfo from PEP 727: https://peps.python.org/pep-0727/

I'm not too familiar with the process in this codebase and what else would be expected, not sure if I'm missing something else, or if there's anything else I should test, order things in a different way, etc. 🤓

@tiangolo tiangolo marked this pull request as ready for review August 28, 2023 21:11
@tiangolo
Copy link
Sponsor Contributor Author

Sorry for the lint errors. 🤦

After the first one, I ran the command locally that exposed the error in tests but I didn't realize there was a different one to expose the error in the source. I hope I got them all now. 😅

@tiangolo
Copy link
Sponsor Contributor Author

BTW, if you want and/or is easier, feel free to discard this PR and make a new one, or take over and commit on top, etc. It's all good. 😄

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

This should also be documented in the changelog and the documentation page. I'll push some changes in a moment.

src/typing_extensions.py Outdated Show resolved Hide resolved
src/typing_extensions.py Outdated Show resolved Hide resolved
src/typing_extensions.py Outdated Show resolved Hide resolved
doc/index.rst Outdated Show resolved Hide resolved
@JelleZijlstra
Copy link
Member

FYI I pushed documentation, a few more dunder methods, and more tests. (I don't know why people like pickling typing objects but they do, so let's test that it works.)

@AlexWaygood
Copy link
Member

I don't know why people like pickling typing objects

though not as much as people like making weakrefs to typing objects, apparently ;)

CHANGELOG.md Outdated Show resolved Hide resolved
doc/index.rst Outdated Show resolved Hide resolved
doc/index.rst Outdated Show resolved Hide resolved
src/typing_extensions.py Outdated Show resolved Hide resolved
doc/index.rst Outdated Show resolved Hide resolved
tiangolo and others added 2 commits August 31, 2023 14:06
doc/index.rst Show resolved Hide resolved
Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Looks good! (Some concerns about the name of the doc section, but that's something we can always change later.)

@tiangolo
Copy link
Sponsor Contributor Author

Thanks @JelleZijlstra! I renamed the section to Annotation metadata as you suggested and @AlexWaygood 👍 -ed.

@tiangolo tiangolo changed the title Add doc and DocInfo from PEP 727: https://peps.python.org/pep-0727/ Add Doc from PEP 727: https://peps.python.org/pep-0727/ Sep 1, 2023
@JelleZijlstra JelleZijlstra merged commit ca2a739 into python:main Sep 8, 2023
17 checks passed
@tiangolo
Copy link
Sponsor Contributor Author

tiangolo commented Sep 8, 2023

We haven't discussed this anywhere yet, but I just realizing (right after you merged this one 🤦), b now that there's only one class Doc there's probably not a strong argument for having the attribute named documentation, do you think it would be better to name it value?

The main argument I can think of for that is that it's shorter and would be somewhat similar to an enum where the actual value is stored in an attribute value. What do you think?

@JelleZijlstra
Copy link
Member

I don't feel too strongly. I think the precise name is nice to make it clear what you are working with (e.g., you can grep for \.documentation more easily than for \.value), and there's some chance we'll add other attributes to the Doc class in the future.

(Just for backward compatibility in typing-extensions, if we do release with .documentation and decide to rename it later, we can preserve compatibility by adding a @property delegating from .documentation to the new name.)

@tiangolo
Copy link
Sponsor Contributor Author

tiangolo commented Sep 8, 2023

Thank you for the quick feedback! Perfect. 🤓🚀

@tiangolo tiangolo deleted the typing-doc branch September 8, 2023 05:44
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.

None yet

5 participants