[issue30377] Unnecessary complexity in tokenize.py around handling of comments and newlines

2017-05-19 Thread Albert-Jan Nijburg
Albert-Jan Nijburg added the comment: Still no CLA, I checked my username on the pdf, and it's correct, hope someone looks at it soon :) -- ___ Python tracker

[issue30377] Unnecessary complexity in tokenize.py around handling of comments and newlines

2017-05-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Don't worry, CLA is accepted manually, and this takes some time. -- ___ Python tracker ___

[issue30377] Unnecessary complexity in tokenize.py around handling of comments and newlines

2017-05-17 Thread Albert-Jan Nijburg
Albert-Jan Nijburg added the comment: I did yesterday, should be coming through today right? -- ___ Python tracker ___

[issue30377] Unnecessary complexity in tokenize.py around handling of comments and newlines

2017-05-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is simple change, and I would write the same code, but just for the case could you please sign CLA? -- ___ Python tracker

[issue30377] Unnecessary complexity in tokenize.py around handling of comments and newlines

2017-05-16 Thread Albert-Jan Nijburg
Albert-Jan Nijburg added the comment: Oh yes you're right! I've updated the code on github. Even cleaner this way :). -- ___ Python tracker ___

[issue30377] Unnecessary complexity in tokenize.py around handling of comments and newlines

2017-05-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka stage: -> patch review ___ Python tracker ___

[issue30377] Unnecessary complexity in tokenize.py around handling of comments and newlines

2017-05-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The code is correct, it just can be made cleaner. No need to backport the change to other versions. The line "if line[pos] in '#\r\n':" looks a kind of optimization. In common case (not a newline and not a comment) there is only one check. The expression

[issue30377] Unnecessary complexity in tokenize.py around handling of comments and newlines

2017-05-16 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +1697 ___ Python tracker ___

[issue30377] Unnecessary complexity in tokenize.py around handling of comments and newlines

2017-05-16 Thread Albert-Jan Nijburg
New submission from Albert-Jan Nijburg: While porting tokenize.py to javascript I stumbled upon this. The bit of code that checks if it's a newline or a comment, checks for comment twice. These can be split up, this way the code is a bit more readable.