-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
PEP 561: Clarify \n
#3428
PEP 561: Clarify \n
#3428
Conversation
Stemming from this python discussion: https://discuss.python.org/t/pep-561-clarification-regarding-n/32875/35 The purpose of this commit is to clarify the wording of the PEP where `partial\n` is concerned to state that the `py.typed` must contain the word `partial` and that `partial` should be on a line by itself.
This comment was marked as resolved.
This comment was marked as resolved.
This is a larger edit than I was expecting, especially given (as mentioned in the linked thread) that most Python programmers will read Perhaps just add a footnote?: -If a stub package distribution is partial it MUST include ``partial\n`` in a
+If a stub package distribution is partial it MUST include ``partial\n`` [2]_ in a In the footnotes section: +.. _[2] ``partial\n`` should be read in the context of a Python string literal,
+ that is, the word "partial" followed by a single new line. A |
Same remark as Adam! |
When I read “string literal”, it makes me think I need to add Why not make the footnote:
This is just about POSIX convention anyway, which it seems from the discussion already goes without saying, so the |
No, python devs should not mix up «string literal» (that can include escape codes) and «raw strings». |
I think we risk over-explaining (or just pedantry) here -- for a Python Enhancement Proposal, we do take some things as read, string literal being one of them. A |
Agreed. I read the whole discuss thread about this and got the general idea that most people interpreted it correctly, with only a possible ambiguity that we agree to make explicit with a footnote. Let’s not make a mountain out of a molehill. |
If it's a string literal, put quotes around it: Saying it should be on a line by itself it the least ambiguous option and requires the least prior knowledge. It's also apparently how it has already been interpreted by the tools that read the file. I support this proposed change. |
What if we just remove the |
If we change more than a footnote, I think we’d need approval by the author @ethanhs or @python/typing |
Great, let’s have that discussion. This PR is about removing the |
I disagree, the PR is about making sure that people interpret the string |
Stemming from this python discussion:
https://discuss.python.org/t/pep-561-clarification-regarding-n/32875/35
The purpose of this commit is to clarify the wording of the PEP where
partial\n
is concerned to state that thepy.typed
must contain the wordpartial
and thatpartial
should be on a line by itself.📚 Documentation preview 📚: https://pep-previews--3428.org.readthedocs.build/