You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
2to3 fix_renames renames sys.maxint only in imports #57462
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2021-10-20.22:46:55.157>created_at=<Date2011-10-24.06:25:52.221>labels= ['type-bug', 'expert-2to3']
title='2to3 fix_renames renames sys.maxint only in imports'updated_at=<Date2021-10-20.22:46:55.156>user='https://github.com/ezio-melotti'
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 bpo-13272.
klimov commented on Sep 15, 2015
klimovmannequin
Mannequin
More actions
I'm interesting to research this.
I can show results by 23 September, I think.
Activity
ezio-melotti commentedon Oct 24, 2011
The maxint in the print should be converted too.
merwok commentedon Oct 27, 2011
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 :)
ezio-melotti commentedon Oct 27, 2011
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 bpo-13272.
klimov commentedon Sep 15, 2015
I'm interesting to research this.
I can show results by 23 September, I think.
klimov commentedon Sep 23, 2015
I'm close to solution, but I need another 1 week.
ezio-melotti commentedon Jan 1, 2016
Nikita, did you manage to find a solution?
If not, do you have a patch (even if not complete) to share?