[issue39670] 2to3 fix_apply tries to fix user-defined apply function calls

2021-10-20 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> wont fix stage: -> resolved status: open -> closed superseder: -> Close 2to3 issues and list them here ___ Python tracker ___

[issue39670] 2to3 fix_apply tries to fix user-defined apply function calls

2020-02-18 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: The fixers are supposed to be executed on Python 2 files where apply was a builtin and was shadowed. So from the context of the fixer it tries to make the modification and it cannot distinguish that it's a builtin or user-defined call. In Python 3

[issue39670] 2to3 fix_apply tries to fix user-defined apply function calls

2020-02-18 Thread ilya
ilya added the comment: > apply was a builtin in Python 2 and not sure 2to3 can differentiate between > user defined functions that shadow builtins. > https://docs.python.org/3.8/library/2to3.html#2to3fixer-apply . > Removes usage of apply(). For example apply(function, *args, **kwargs) is

[issue39670] 2to3 fix_apply tries to fix user-defined apply function calls

2020-02-18 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: apply was a builtin in Python 2 and not sure 2to3 can differentiate between user defined functions that shadow builtins. https://docs.python.org/3.8/library/2to3.html#2to3fixer-apply . Removes usage of apply(). For example apply(function, *args, **

[issue39670] 2to3 fix_apply tries to fix user-defined apply function calls

2020-02-18 Thread ilya
New submission from ilya : Consider the following code: def apply(a, b): print(a) print(b) apply(1, 1) 2to3 suggests to fix it as follows: --- a.py(original) +++ a.py(refactored) @@ -2,4 +2,4 @@ print(a) print(b) -apply(1, 1) +(1)(*1) -- component