PEP 846: Docstrings for type aliases - #5116
Conversation
Documentation build overview
5 files changed ·
|
| :py:keyword:`type` statements and makes the first following docstring | ||
| available at runtime. | ||
|
|
||
| If the next statement after a :py:keyword:`type` statement in the same suite is |
There was a problem hiding this comment.
Worth saying explicitly that there may be comments and blank lines between the type statement and its docstring?
| used by inspection tools rather than compilation. | ||
|
|
||
| The attribute can be assigned to after creation. Deleting it resets it to | ||
| ``None``. The :py:class:`~typing.TypeAliasType` constructor does not gain a |
There was a problem hiding this comment.
Wasn't sure.
dataclasses.field(doc=...) is a good precedent, the API will be more convenient.
I've changed my mind, I'll add the new parameter.
| Discussions-To: Pending | ||
| Status: Draft | ||
| Type: Standards Track | ||
| Topic: Typing |
There was a problem hiding this comment.
It's Topic: Typing, but there's nothing for type checkers to do. I can't really think of much type checkers could do with this PEP; maybe they could have some verbose diagnostics mode that shows alias docstrings, but that's not something the PEP should prescribe.
I guess this Topic implies that the Typing Council should opine on this PEP. And maybe there should be a line making it explicit that no changes in type checker behavior are expected.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
I've just started the work on the PEP, hence a draft PR to book the number.
PR template checkboxes
Basic requirements (all PEP Types)
pep-NNNN.rst), PR title (PEP 123: <Title of PEP>) andPEPheaderuvx pepotron next(orpipx install pepotronthenpep next)AuthororSponsor, and formally confirmed their approvalAuthor,Status(Draft),TypeandCreatedheaders filled out correctlyPEP-Delegate,Topic,RequiresandReplacesheaders completed if appropriate.github/CODEOWNERSfor the PEPStandards Track requirements
Python-Versionset to valid (pre-beta) future Python version, if relevantDiscussions-ToandPost-History