Issue13253
Created on 2011-10-24 06:25 by ezio.melotti, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Messages (6) | |||
|---|---|---|---|
| msg146278 - (view) | Author: Ezio Melotti (ezio.melotti) * ![]() |
Date: 2011-10-24 06:25 | |
$ cat deleteme.py
from sys import maxint
print 'maxint', maxint
$ 2to3 deleteme.py
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: Refactored deleteme.py
--- deleteme.py (original)
+++ deleteme.py (refactored)
@@ -1,2 +1,2 @@
-from sys import maxint
-print 'maxint', maxint
+from sys import maxsize
+print('maxint', maxint)
RefactoringTool: Files that need to be modified:
RefactoringTool: deleteme.py
The maxint in the print should be converted too.
|
|||
| msg146493 - (view) | Author: Éric Araujo (eric.araujo) * ![]() |
Date: 2011-10-27 15:37 | |
Do people really import maxint from sys? I’d find that less readable than using sys.maxint —which should, if you ask me, also be replaced :) |
|||
| msg146495 - (view) | Author: Ezio Melotti (ezio.melotti) * ![]() |
Date: 2011-10-27 15:44 | |
I do (or at least did it in at least one place :). I think the problem is actually more general, and I don't know if it's by design. If a name in the import is changed, all the other occurrences of the name should be changed as well. I don't know if 2to3 is powerful enough to recognize what occurrences should be left untouched (e.g. if I also have maxsize = 100 inside a function), and how difficult would it be to do it. See also #13272. |
|||
| msg250802 - (view) | Author: Nikita Klimov (klimov) | Date: 2015-09-15 20:16 | |
I'm interesting to research this. I can show results by 23 September, I think. |
|||
| msg251460 - (view) | Author: Nikita Klimov (klimov) | Date: 2015-09-23 21:36 | |
I'm close to solution, but I need another 1 week. |
|||
| msg257275 - (view) | Author: Ezio Melotti (ezio.melotti) * ![]() |
Date: 2016-01-01 05:29 | |
Nikita, did you manage to find a solution? If not, do you have a patch (even if not complete) to share? |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:23 | admin | set | github: 57462 |
| 2021-10-20 22:46:55 | iritkatriel | set | status: open -> closed superseder: Close 2to3 issues and list them here resolution: wont fix stage: needs patch -> resolved |
| 2016-01-01 05:29:28 | ezio.melotti | set | messages:
+ msg257275 versions: - Python 3.2, Python 3.3, Python 3.4 |
| 2015-09-23 21:36:24 | klimov | set | messages: + msg251460 |
| 2015-09-15 20:16:52 | klimov | set | nosy:
+ klimov messages:
+ msg250802 |
| 2011-10-27 15:44:52 | ezio.melotti | set | messages: + msg146495 |
| 2011-10-27 15:37:48 | eric.araujo | set | nosy:
+ eric.araujo messages: + msg146493 |
| 2011-10-27 14:14:21 | meador.inge | set | nosy:
+ meador.inge |
| 2011-10-24 06:25:52 | ezio.melotti | create | |
