Eric Snow <ericsnowcurren...@gmail.com> added the comment:
FTR: As Martin noted in #19514, there isn't any performance difference for statics, whether local or global. For static locals the compiler (at least on linux) generates symbols named as "<name>.<#>" and they are treated as global. One key difference (again, at least on linux; seen using "nm") is that symbols for static globals preserve identifying information, like the originating source file. For static locals the filename is not preserved and, when there are duplicates, you do not know from which function a particular symbol comes. So compiled symbols for static globals are *much* easier to identify in the source than symbols for static locals. Hence static locals complicate something I'm working on: tooling to identify global variables in our source code. So I'm a fan of efforts to remove duplicates (and move static locals to the explicit global namespace). Thank you! :) ---------- nosy: +eric.snow _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39487> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com