[issue29285] Unicode errors occur inside of multi-line comments

2017-01-17 Thread John Taylor
John Taylor added the comment: OP here, thanks for replying to this. I used Zach's suggestion of placing an 'r' in front of triple-quotes. This accomplishes my goal. -- ___ Python tracker ___

[issue29285] Unicode errors occur inside of multi-line comments

2017-01-17 Thread Eryk Sun
Eryk Sun added the comment: > they do not appear in the byte code files It's simple to coonfirm that unassigned string literals get thrown away.: >>> code = compile('"doc"\n"unused"\n"us"+"ed"', '', 'exec') >>> code.co_consts ('doc', 'us', 'ed', None, 'used') >>> dis.dis(code)

[issue29285] Unicode errors occur inside of multi-line comments

2017-01-17 Thread R. David Murray
R. David Murray added the comment: @zach: actually, triple quoted strings *are* suggested as a way to do multiline comments, and are often used for that. In particular, note that they do not appear in the byte code files if they are not assigned to anything or appear in the docstring position

[issue29285] Unicode errors occur inside of multi-line comments

2017-01-16 Thread Zachary Ware
Zachary Ware added the comment: Triple-quoted strings are strings, not multi-line comments, though people do abuse them for that purpose sometimes. Changing this behavior would be a huge change for next to no benefit, so I'm closing the issue. If you insist on using a triple-quoted string as

[issue29285] Unicode errors occur inside of multi-line comments

2017-01-16 Thread John Taylor
New submission from John Taylor: I am using Python 3.5.2 on OS X 10.11.6. The same error occurs with 3.5.2 on Windows 10. When I run the attached code, I get this error: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 23-24: truncated \u escape I think