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

Consider including discussion of "type completeness" #94

Closed
erictraut opened this issue Jan 16, 2021 · 5 comments
Closed

Consider including discussion of "type completeness" #94

erictraut opened this issue Jan 16, 2021 · 5 comments

Comments

@erictraut
Copy link

One of the ideas we’d really like to push is the notion of “type completeness” for library interfaces. Getting to type completeness will be a journey and a large investment for many library maintainers, but I think it’s important for guidance to paint a picture of the future we want to see.

Would you be open to formalizing the notion of “type completeness” and including this in the PEP, or do you think that would be out of place?

For details about how we have been thinking about type completeness, refer to this document.

Incidentally, I already have a mode in pyright that computes the type completeness of a “py.typed” package and reports which percentage of symbols are fully typed (as opposed to partially or fully untyped).

@srittau
Copy link
Owner

srittau commented Feb 1, 2021

I am sorry for the delay. I still plan on looking at this, but haven't found the time, yet.

@srittau
Copy link
Owner

srittau commented Aug 23, 2021

@erictraut We're integrating this PEP into the typing docs (https://github.com/python/typing/tree/master/docs). Maybe your document would be appropriate there as well?

@srittau srittau closed this as completed Aug 23, 2021
@erictraut
Copy link
Author

@srittau, thanks for the suggestion.

Have you read the full document Type Completeness for Python Libraries? Do you agree with all of its contents, or do you have feedback? I haven't received much feedback, so the contents are largely unchanged from my original draft. I would want to make sure that there's a level of agreement before posting it to the python/typing site.

Do you think we should incorporate the entire document? Parts of it? Just include a link to it?

@srittau
Copy link
Owner

srittau commented Aug 30, 2021

@erictraut I finally managed to read it, sorry for taking so long. There are certainly details that can be discussed, but nothing "outrageous" that we shouldn't recommend. For now, I think the document could be well included into the typing docs as is. After that, a few changes I would recommend:

  • Convert to restructed text to fit with the rest of the typing docs (and Python docs in general).
  • Update a few recommended practices like using list instead of List.
  • Add a link to the existing stubs document.

In the long run, I think this would make a good basis for a "How to type annotate a library" document. It makes sense to me to split out some chapters into separate documents, possibly merging them with existing or new texts. For example, the best practices section could be merged with some recommendations from the stubs document to form a new general "best practices" document (see also python/typing#851). In python/typing#845 I have some ideas on how to structure the documentation.

@erictraut
Copy link
Author

You're welcome to incorporate the document as is. I'm not sure where it needs to go, so I'll leave that to you.

If you'd like help writing a "How to type annotate a library" document, I'd be interested in authoring or contributing. If that's something you're interested in, it would help me get started if you would create a placeholder document in the desired location and file format. I could then work on filling in content and submit a PR (or series of PRs) for your review.

srittau added a commit to srittau/typing that referenced this issue Sep 9, 2021
By Eric Traut, source: https://raw.githubusercontent.com/microsoft/pyright/main/docs/typed-libraries.md

See srittau/peps#94 for background.

This is a pristine copy of the original document. It needs to be
converted into RestructuredText and linked from the index as a next
step.
JelleZijlstra pushed a commit to python/typing that referenced this issue Sep 14, 2021
By Eric Traut, source: https://raw.githubusercontent.com/microsoft/pyright/main/docs/typed-libraries.md

See srittau/peps#94 for background.

This is a pristine copy of the original document. It needs to be
converted into RestructuredText and linked from the index as a next
step.
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

No branches or pull requests

2 participants