[issue31906] String literals next to each other does not cause error

2017-10-30 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

What Dmitry said :) I'm closing this as "not a bug".

--
nosy: +Mariatta
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
versions:  -Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31906] String literals next to each other does not cause error

2017-10-30 Thread Dmitry Kazakov

Dmitry Kazakov  added the comment:

This is a documented feature: 
https://docs.python.org/3/reference/lexical_analysis.html#string-literal-concatenation

And yes, it was discussed before: 
https://mail.python.org/pipermail/python-ideas/2013-May/020527.html

--
nosy: +vaultah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31906] String literals next to each other does not cause error

2017-10-30 Thread Sam Lobel

Change by Sam Lobel :


--
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31906] String literals next to each other does not cause error

2017-10-30 Thread Sam Lobel

New submission from Sam Lobel :

This seems too obvious to have been missed, but also too strange behaviour to 
be on purpose.

The following works for some reason (note there's no + between the words)
>>> variable = "first" "second"
>>> print(variable)
"firstsecond"

In a file, if you're missing a comma between two string literals, it combines 
them into one string (instead of throwing a syntax error). E.G:

>>> a = ["first",
... "second"
... "third"]
>>> print(a)
["first" "secondthird"]

BUT, the same thing with variables (thankfully) does not work.
>>> a = "first"
>>> b = "second"
>>> c = a b
Throws a syntax error.

The same sort of thing also breaks for integers.
>>> a = 4 7
throws a syntax error.

This just seems wrong to me. Is it? Has this been discussed a million times 
before?

--
messages: 305252
nosy: Sam Lobel2
priority: normal
severity: normal
status: open
title: String literals next to each other does not cause error
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com