GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-107017: Change Chapter Strings to Texts in the Introduction chapter. by TommyUnreal · Pull Request #107104 · python/cpython

Conversation

@TommyUnreal

@TommyUnreal TommyUnreal commented Jul 23, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

  • Issue: remove the assumptions from The tutorial #107017

📚 Documentation preview 📚: https://cpython-previews--107104.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@TommyUnreal
Change Strings to Texts in introduction chapter.
27bd6d5
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.
@bedevere-bot bedevere-bot mentioned this pull request Jul 23, 2023
remove the assumptions from The tutorial #107017
Closed
@bedevere-bot bedevere-bot added awaiting review docs Documentation in the Doc dir skip news labels Jul 23, 2023
evildmp
evildmp suggested changes Jul 23, 2023
View reviewed changes
Comment thread Doc/tutorial/introduction.rst Outdated
.. _tut-strings:

Strings
Texts

@evildmp evildmp Jul 23, 2023

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 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

@evildmp evildmp Jul 23, 2023

Copy link
Copy Markdown
Contributor

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 [...].

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 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::

@evildmp evildmp Jul 23, 2023

Copy link
Copy Markdown
Contributor

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 \::

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 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

@evildmp evildmp Jul 23, 2023

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Jul 23, 2023
@TommyUnreal
New structure of first paragraph in Text chapter.
3edff8b
evildmp
evildmp approved these changes Jul 23, 2023
View reviewed changes
@TommyUnreal
Refactor string quotes handling and examples.
de2e3c5
Changed the description, removed duplicate explanations and reworked
examples so they are more consice with its paragraph.
@TommyUnreal
TommyUnreal requested a review from evildmp July 23, 2023 11:54
evildmp
evildmp suggested changes Jul 23, 2023
View reviewed changes
Comment thread 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

@evildmp evildmp Jul 23, 2023

Copy link
Copy Markdown
Contributor

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..."

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@TommyUnreal
Replaced interactive interpreter with Python shell
0306f45
evildmp
evildmp approved these changes Jul 23, 2023
View reviewed changes
hugovk
hugovk requested changes Jul 23, 2023
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

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!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting changes and removed awaiting core review labels Jul 23, 2023
@bedevere-bot

bedevere-bot commented Jul 23, 2023

Copy link
Copy Markdown

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk hugovk added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Jul 23, 2023
TommyUnreal and others added 3 commits July 23, 2023 22:10
@TommyUnreal @hugovk
Adjust length to match header
7bd1f2a
Co-authored-by: Hugo van Kemenade <[email protected]>
@TommyUnreal @hugovk
Fix grammar.
bd02929
Co-authored-by: Hugo van Kemenade <[email protected]>
@TommyUnreal @hugovk
Add a space before the hash to follow PEP 8
ef4f321
Co-authored-by: Hugo van Kemenade <[email protected]>
@TommyUnreal

TommyUnreal commented Jul 23, 2023

Copy link
Copy Markdown
Contributor Author

Some minor suggestions, thanks for the PR!

Thank you for the feedback!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TommyUnreal @hugovk
Add a space before the hash to follow PEP 8
b737cac
Co-authored-by: Hugo van Kemenade <[email protected]>
hugovk
hugovk approved these changes Jul 24, 2023
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

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!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting changes labels Jul 24, 2023
@hugovk
hugovk enabled auto-merge (squash) July 24, 2023 05:55
@hugovk
hugovk merged commit 2cf9902 into python:main Jul 24, 2023
@miss-islington

miss-islington commented Jul 24, 2023

Copy link
Copy Markdown
Contributor

Thanks @TommyUnreal for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label Jul 24, 2023
@bedevere-bot

bedevere-bot commented Jul 24, 2023

Copy link
Copy Markdown

GH-107167 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 24, 2023
@TommyUnreal @hugovk @miss-islington
pythongh-107017: Change Chapter Strings to Texts in the Introduction …
220780b
…chapter. (pythonGH-107104)

(cherry picked from commit 2cf9902)

Co-authored-by: TommyUnreal <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Jul 24, 2023
@bedevere-bot

bedevere-bot commented Jul 24, 2023

Copy link
Copy Markdown

GH-107168 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 24, 2023
@TommyUnreal @hugovk @miss-islington
pythongh-107017: Change Chapter Strings to Texts in the Introduction …
59a5d76
…chapter. (pythonGH-107104)

(cherry picked from commit 2cf9902)

Co-authored-by: TommyUnreal <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 24, 2023
hugovk added a commit that referenced this pull request Jul 24, 2023
@miss-islington @TommyUnreal @hugovk
[3.12] gh-107017: Change Chapter Strings to Texts in the Introduction…
beb5514
… chapter. (GH-107104) (#107167)

Co-authored-by: TommyUnreal <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
hugovk added a commit that referenced this pull request Jul 24, 2023
@miss-islington @TommyUnreal @hugovk
[3.11] gh-107017: Change Chapter Strings to Texts in the Introduction…
8725d36
… chapter. (GH-107104) (#107168)

Co-authored-by: TommyUnreal <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
carljm added a commit to carljm/cpython that referenced this pull request Jul 24, 2023
@carljm
Merge branch 'main' into superfix
9a6bdfa
* 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)
  ...
@zware zware mentioned this pull request Jun 3, 2024
Tutorial - Broken Sentence #119995
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk approved these changes
+1 more reviewer
@evildmp evildmp evildmp approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@TommyUnreal @bedevere-bot @miss-islington @evildmp @hugovk
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.