-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
gh-107017: Change Chapter Strings to Texts in the Introduction chapter. #107104
gh-107017: Change Chapter Strings to Texts in the Introduction chapter. #107104
Conversation
While term "string" is well known in computer science, it might not resonate with beginners or non-technical individuals. Term Texts emphasize practical application in similar way to Numbers and Lists chapters. This can make the introduction part less intimidating and more beginner-oriented. On the other hand people comming from other technologies will not be surprised that text is represented with strings.
Doc/tutorial/introduction.rst
Outdated
@@ -138,13 +138,14 @@ and uses the ``j`` or ``J`` suffix to indicate the imaginary part | |||
|
|||
.. _tut-strings: | |||
|
|||
Strings | |||
Texts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd actually keep the heading Strings, because that's the correct name.
Doc/tutorial/introduction.rst
Outdated
in several ways. They can be enclosed in single quotes (``'...'``) or | ||
double quotes (``"..."``) with the same result [#]_. ``\`` can be used | ||
to escape quotes:: | ||
Different kinds of text have the type :class:`str`. This includes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest:
Python can manipulate text ("strings") as well as numbers. This can include [your list of examples].
Strings are enclosed [...].
Doc/tutorial/introduction.rst
Outdated
characters "``!``", words "``rabbit``", names "``Paris``", sentences | ||
"``Got your back.``", etc. "``Yay! :)``". They can be enclosed in single | ||
quotes (``'...'``) or double quotes (``"..."``) with the same result [#]_. | ||
``\`` can be used to escape quotes:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the concept of escaping (and the word) is not familiar to many beginners, so I'd suggest something like:
To quote a quote, we need to "escape" it, by preceding it with
\
::
Doc/tutorial/introduction.rst
Outdated
to escape quotes:: | ||
Different kinds of text have the type :class:`str`. This includes | ||
characters "``!``", words "``rabbit``", names "``Paris``", sentences | ||
"``Got your back.``", etc. "``Yay! :)``". They can be enclosed in single |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add:
Even "123" is a string (and not a number - because it's enclosed in quotes.
Changed the description, removed duplicate explanations and reworked examples so they are more consice with its paragraph.
Doc/tutorial/introduction.rst
Outdated
strings are equivalent. The string is enclosed in double quotes if | ||
the string contains a single quote and no double quotes, otherwise it is | ||
enclosed in single quotes. The :func:`print` function produces a more | ||
In the interactive interpreter, the string definition and output string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"In the Python shell..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor suggestions, thanks for the PR!
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Thank you for the feedback! |
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thanks @TommyUnreal for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
GH-107167 is a backport of this pull request to the 3.12 branch. |
…chapter. (pythonGH-107104) (cherry picked from commit 2cf9902) Co-authored-by: TommyUnreal <45427816+TommyUnreal@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
GH-107168 is a backport of this pull request to the 3.11 branch. |
…chapter. (pythonGH-107104) (cherry picked from commit 2cf9902) Co-authored-by: TommyUnreal <45427816+TommyUnreal@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* main: (73 commits) Thoroughly refactor the cases generator (python#107151) Docs: Add missing markup to Argument Clinic docs (python#106876) pythongh-107162: Document errcode.h usage in its comment (python#107177) pythongh-106320: Remove private _PyDict C API (python#107145) Fix PyVectorcall_Function doc versionadded (python#107140) Docs: Remove duplicate word in Argument Clinic howto heading (python#107169) pythongh-107017: Change Chapter Strings to Texts in the Introduction chapter. (python#107104) pythongh-106320: Remove private _PyObject C API (python#107159) Docs: fix typo in os.pwrite docstring (python#107087) pythongh-105291: Add link to migration guide for distutils (python#107130) pythongh-106948: Docs: Disable links for C standard library functions, OS utility functions and system calls (python#107062) pythongh-106320: Remove _PyBytes_Join() C API (python#107144) pythongh-106320: Remove private _PyObject C API (python#107147) pythongh-106320: Remove _PyTuple_MaybeUntrack() C API (python#107143) pythongh-106320: Remove _PyIsSelectable_fd() C API (python#107142) Remove superflous whitespaces in `layout.html`. (pythonGH-107067) pythongh-107122: Update what's news for dbm.*dbm.clear() method (pythongh-107135) pythongh-107122: Add clear method to dbm.ndbm module (pythongh-107126) pythongh-62519: Make pgettext search plurals when translation is not found (python#107118) pythongh-107122: Add clear method to dbm.gdbm.module (pythongh-107127) ...
While the term "string" is well-known in computer science, it might not resonate with beginners or non-technical individuals. Term Texts emphasize practical application in a similar way to Numbers and Lists chapters. This can make the introduction part less intimidating and more beginner-oriented. On the other hand, people coming from other technologies will not be surprised that text is represented with strings.
📚 Documentation preview 📚: https://cpython-previews--107104.org.readthedocs.build/