Skip to content

Example code shadows builtin #1

Description

@spamwise

Reusing the name of a builtin function for a local variable is technically permitted by Python, but is considered extremely bad practice, to the point where if you were to do this in an interview after advertising yourself as a Python programmer, it would likely disqualify you.

This came to my attention via SO: https://stackoverflow.com/questions/75564166/what-is-shadow-built-in-name-sum and seemed so bad for something that's intended as a guide for beginners that I felt it was important to come and give feedback. My recommendation would be to run all the code in this book through a standard linter; my guess is that other issues will come to light and it will be a simple matter to fix them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions