Terry J. Reedy added the comment:

I added 5-tuple mode to roundtrip() in #20750. I solved the ENDMARKER problem 
by breaking out of the token loop if and when it appears. Reconstructing 
trailing whitespace other than \n is hopeless. The roundtrip test currently 
only tests equality of token sequences. But my own tests show that code with 
backslash-newline is reconstructed correctly as long as there is no space 
before it and something other than ENDMARKER after it.

I discovered that tokenize will tokenize '\\' but not '\\\n'. So the latter 
will never appear as tokenizer output. Even if we did use ENDMARKER to create 
the latter, it would fail the current roundtrip test.

----------
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9974>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to