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

Conversation

sietse
Copy link

@sietse sietse commented Dec 2, 2013

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.

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.
@ivarne
Copy link
Sponsor Member

ivarne commented Dec 2, 2013

A string literal can be written in double quotes, or tripple double quotes """This is a string literal where I dont have to escape " characters."""

@StefanKarpinski
Copy link
Sponsor Member

These changes may be a bit forceful in tone for my style, which tends to be a bit understated, but you're absolutely right that this point could be make a bit more clearly. Also, I love your Moomin avatar :-)

@sietse
Copy link
Author

sietse commented Dec 2, 2013

And I love your Viking helmet. :-)

In many other languages, 'a', and "a" would amount to the same thing, so I thought that just this once I'd put in a 'must' to prevent the user from going astray and trying to write a character as "a". But you're right that the italics are too much, so I took those out. Do you want a further rewrite, or will this do?

@@ -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 <http:https://en.wikipedia.org/wiki/Code_point>`_. Here is how ``Char``
values are input and shown:
point <http: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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants