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
IDLE: Stop reusing built-in names as parameters #96905
Some idlelib functions use built-in names such as 'object', 'dict', and 'type' as function parameter names. As a result, these parameter names are mistakenly highlighted as builtin names. Unless a parameter name is used as a keyword in any call of the function, changing a parameter name within a function should cause no problems.
The easiest name change is to append '_'. That is what I have done so far to get 'object_' and 'dict_' in my b_ins branch.
EDIT: In appropriate places, I prefixed 'g' or 'l', for 'global or 'local', to 'dict'.
I am deferring replacements of 'type' to another issue (currently draft). It has at least as many hits as 'dict' and 'object' combined, and many are argument names in non-idlelib modules. Am closing this and the linked master issue.
Activity
[-]IDLE: Stop reusing built-in names[/-][+]IDLE: Stop reusing built-in names as parameters[/+]pythongh-96905: IDLE - Stop reusing built-in names
gh-96905: In IDLE code, stop redefining built-ins 'dict' and 'object' (…
pythongh-96905: In IDLE code, stop redefining built-ins 'dict' and 'o…
pythongh-96905: In IDLE code, stop redefining built-ins 'dict' and 'o…
[3.11] gh-96905: In IDLE code, stop redefining built-ins 'dict' and '…
terryjreedy commentedon Jan 18, 2024
I am deferring replacements of 'type' to another issue (currently draft). It has at least as many hits as 'dict' and 'object' combined, and many are argument names in non-idlelib modules. Am closing this and the linked master issue.
[3.12] gh-96905: In IDLE code, stop redefining built-ins 'dict' and '…
pythongh-96905: In IDLE code, stop redefining built-ins 'dict' and 'o…
pythongh-96905: In IDLE code, stop redefining built-ins 'dict' and 'o…
pythongh-96905: In IDLE code, stop redefining built-ins 'dict' and 'o…