STINNER Victor <[EMAIL PROTECTED]> added the comment:

@loewis: Ok, I didn't know. I think that it's better to reuse existing 
code.

I also compared the implementations of encoding detection, and the 
code looks the same in IDLE and tokenize, but I prefer tokenize. 
tokenize.detect_encoding() has longer documentation, return the line 
(decoded as Unicode) matching the encoding cookie, and look to be more 
robust.

I saw an interesting test in IDLE code: it checks the charset. So I 
wrote a patch raising a SyntaxError for tokenize: issue4021.

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4008>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to