[issue45736] 2to3 does not support integer division fixing

2021-11-18 Thread Łukasz Langa
Łukasz Langa added the comment: We don't accept new features for 3.10 anymore, and since 2to3 is deprecated, we won't be updating it with new fixers and so on. It is pending removal in Python 3.13. Sorry, I understand this is a bummer but this part of Python hasn't seen serious development f

[issue45736] 2to3 does not support integer division fixing

2021-11-06 Thread theeshallnotknowethme
Change by theeshallnotknowethme : -- versions: -Python 3.11, Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue45736] 2to3 does not support integer division fixing

2021-11-06 Thread theeshallnotknowethme
Change by theeshallnotknowethme : -- versions: +Python 3.11, Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue45736] 2to3 does not support integer division fixing

2021-11-06 Thread theeshallnotknowethme
theeshallnotknowethme added the comment: A correction to the discussion: The PR I made only fixes CONSTANT integer division, not any other. The left and right operands are checked for non-constants and then are checked for integerness (specifically checks for `NOT A FLOAT`s). After both chec

[issue45736] 2to3 does not support integer division fixing

2021-11-06 Thread theeshallnotknowethme
theeshallnotknowethme added the comment: I have put some effort to make it work for constant integers. So this x = a ** 3 / 7 would not be changed, since it refers to a name whose value is not known. -- ___ Python tracker

[issue45736] 2to3 does not support integer division fixing

2021-11-06 Thread Eric V. Smith
Eric V. Smith added the comment: I think knowing that that's integer division is beyond what 2to3 can accomplish. Plus, with lib2to3 being deprecated, I don't think anyone's going to put any effort into this. -- nosy: +eric.smith ___ Python tracke

[issue45736] 2to3 does not support integer division fixing

2021-11-06 Thread theeshallnotknowethme
theeshallnotknowethme added the comment: When 2to3 supports integer division fixing, there would be this behaviour: - x = 2 ** 8 / 5 / 7 + x = 2 ** 8 // 5 // 7 Basically convert any integer division to floor division. The PR I made only works for constant integers, and any improvement would

[issue45736] 2to3 does not support integer division fixing

2021-11-06 Thread theeshallnotknowethme
Change by theeshallnotknowethme : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue45736] 2to3 does not support integer division fixing

2021-11-06 Thread theeshallnotknowethme
Change by theeshallnotknowethme : -- keywords: +patch pull_requests: +27694 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29440 ___ Python tracker __

[issue45736] 2to3 does not support integer division fixing

2021-11-06 Thread theeshallnotknowethme
New submission from theeshallnotknowethme : Right now, 2to3 does not support integer division fixing. Supposing `test.py` is a file with these contents: x = 2 ** 8 / 5 / 7 Here's an example: C:\Users\admin> py -m lib2to3 test.py RefactoringTool: Skipping optional fixer: buffer RefactoringTool: