[issue2374] Use of builtin file should give Py3k warning

2008-03-17 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Yeah, breaking isinstance(x, file) would be bad and 2to3 can do this automatically. I should probably learn how to write fixers. BTW, the warning culprit was actually site.py which used file. __ Tracker <[EM

[issue2374] Use of builtin file should give Py3k warning

2008-03-17 Thread Guido van Rossum
Guido van Rossum <[EMAIL PROTECTED]> added the comment: Let's not do this. This approach is not sufficiently backwards compatible; it will break any code that uses isinstance(x, file). Even though that's not forward compatible with 3.0, it works in 2.5 and before, so it should not break in 2.6.

[issue2374] Use of builtin file should give Py3k warning

2008-03-17 Thread Guido van Rossum
Guido van Rossum <[EMAIL PROTECTED]> added the comment: I'll review this. My hunch is that we don't need this -- 2to3 takes care of this so there is no reason to tell people to change their code by hand. (You may notice a pattern -- things that 2to3 can fix easily generally don't deserve -3 wa

[issue2374] Use of builtin file should give Py3k warning

2008-03-17 Thread Benjamin Peterson
New submission from Benjamin Peterson <[EMAIL PROTECTED]>: This patch causes the use of builtin file to give a Py3k warning. When Python starts up, distutils.text_file gives a warning because it uses a variable named file. I imagine there are places like this all over in the stdlib, which should