Skip to content

removed a pitfall where a built-in name was being shadowed#310

Open
NaelsonDouglas wants to merge 1 commit intolukemelas:masterfrom
python-pitfalls:master
Open

removed a pitfall where a built-in name was being shadowed#310
NaelsonDouglas wants to merge 1 commit intolukemelas:masterfrom
python-pitfalls:master

Conversation

@NaelsonDouglas
Copy link

@NaelsonDouglas NaelsonDouglas commented Nov 2, 2021

The problem
There was a scenario on the code where a Python built-in name was being shadowed.
It's a good practice to never replace built-in methods with variables, since it may lead to hard-to-detect bugs in a scenario where the name gets invoked bearing in mind its built-in purpose instead of the newly shadowed purpose.

Solution
Changed the variable name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant