[issue29668] f-strings don't change the values as expected.

2017-02-27 Thread Rafael Capucho
Rafael Capucho added the comment: Serhiy Storchaka, Thank you for your explanation. -- ___ Python tracker ___

[issue29668] f-strings don't change the values as expected.

2017-02-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The expression is a concatenation of f-string expression f"SELECT COUNT(*) " and three string literals. If you want to substitute the "a" value, convert string literals into f-string expressions: query = (f"SELECT COUNT(*) " f"FROM `{a}` entry "

[issue29668] f-strings don't change the values as expected.

2017-02-27 Thread Rafael Capucho
Rafael Capucho added the comment: I got: SELECT COUNT(*) FROM `{a}` entry WHERE entry.type == 'device' AND entry.instance == {a} I expect the value of `{a}` changed, like: SELECT COUNT(*) FROM `some_underscored_value` entry WHERE entry.type == 'device' AND entry.instance ==

[issue29668] f-strings don't change the values as expected.

2017-02-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What you get? What you expect? -- ___ Python tracker ___ ___

[issue29668] f-strings don't change the values as expected.

2017-02-27 Thread Rafael Capucho
Rafael Capucho added the comment: ``` a = "some_underscored_value" u = (f" hello `{a}` cruel world" " hi") print(u) query = (f"SELECT COUNT(*) " "FROM `{a}` entry " "WHERE entry.type == 'device' " "AND entry.instance == {a}") print(query) ``` --

[issue29668] f-strings don't change the values as expected.

2017-02-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please provide your example as a text. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue29668] f-strings don't change the values as expected.

2017-02-27 Thread Rafael Capucho
New submission from Rafael Capucho: In the attached file, the lines 4 and 6 have the same structure, the line 4 changes the value of {a} properly, the line 6 didn't. Thank you. -- components: Interpreter Core files: crazy.png messages: 288649 nosy: Rafael Capucho priority: normal