DEV Community

Discussion on: 5 common mistakes made by beginner Python programmers

Collapse
 
johncip profile image
jmc • Edited

The names are under function scope, but the values are stored as entries in a collection (tuple I think?) called func_defaults (__defaults__ in 3). It's attached to the function object, so I think that means it has the same scope as the declaration.

Python 🙄