-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Future of typing_extensions.Doc #443
Comments
I've imagined a worst case scenario: After the proposed hint is abandoned the name is later reused in a new PEP with incompatible syntax than the initial proposal. This situation would force Have you considered PEP 702, the Because a hint might be reused for something different I would suggest using
The other option is mainly using PEP 562 which even shows examples of using module level |
I realize after reading the linked discussion that this issue might've been more about the philosophy of keeping Obviously you can't remove |
"Have you considered PEP 702" was pretty amusing to read :). Yes, I have considered it. In fact, I wrote it. We could use it here, but it feels wrong to mark something as |
I apologize for being a dunce, I tend to gloss over the author field of PEP's. Obviously the maintainers of
It's simple, you mark it as Of course, any deprecation warning for attempting to use the hint is the opposite of an endorsement. So less of a chance of having Instead of deprecation, keeping I personally don't like Maybe mark |
PEP-727 proposed a new
Doc
construct, but the PEP is unlikely to be accepted and will probably be withdrawn (https://discuss.python.org/t/pep-727-documentation-metadata-in-typing/32566/181).That makes it so we have to figure out what to do with
typing_extensions.Doc
in the future. We don't have any previous cases where a feature was proposed in a PEP that didn't get accepted. We do have the precedent oftyping_extensions.IntVar
, which was added a long time ago without ever being proposed in a PEP. It is still intyping_extensions
but undocumented.I'm hesitant to remove importable objects from typing_extensions, because this library is so widely used and is a dependency of many other important libraries. If we remove something, we could end up breaking an important third-party library. Libraries could also end up pinning the version of typing-extensions they depend on, which is disruptive because it restricts users using that library from using new features of newer versions of typing-extensions.
Doc
is also quite simple (a single class of a few dozen lines; no interaction with other features). Therefore, I don't see a big problem with keeping it around. However, we should mark it as deprecated in the documentation and probably move it into its own section.The text was updated successfully, but these errors were encountered: