Skip to content
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

Make string/character quoting rules explicit #5006

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make string/character quoting rules explicit
A string literal must be written in single quotes.
A string literal must be written in double quotes.
The documentation implied this, but not very clearly; 
now it is explicit.
  • Loading branch information
sietse committed Dec 2, 2013
commit fe831230dbb65987466e464aea45ef103c34437d
7 changes: 4 additions & 3 deletions doc/manual/strings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ Characters
A ``Char`` value represents a single character: it is just a 32-bit
integer with a special literal representation and appropriate arithmetic
behaviors, whose numeric value is interpreted as a `Unicode code
point <https://en.wikipedia.org/wiki/Code_point>`_. Here is how ``Char``
values are input and shown:
point <https://en.wikipedia.org/wiki/Code_point>`_. A ``Char``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar: "Char values", not "A Char values. And I would phrase it:

  • Char literal values are delimited by single quotes:

values must be input in single quotes:

.. doctest::

Expand Down Expand Up @@ -184,7 +184,8 @@ You can do comparisons and a limited amount of arithmetic with
String Basics
-------------

Here a variable is initialized with a simple string literal:
String literals are typed in double quotes. Here a variable is
initialized with a simple string literal:

.. doctest::

Expand Down