Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comprehensive overview of strings I should NOT use for local variables?

If I understood correctly, it's better not to use an expression for a local variable that's already a global function in Python. So I believe this

list = [1,2,3]

is disrecommended in favor of

mylist = [1,2,3]

because list is already a built-in object in Python and mylist is not. However, I'm not always sure whether I should or should not use some expression (e.g. dir, num or cnt). Is there any comprehensive overview of the strings I'd better avoid for naming local variables?

like image 548
RubenGeert Avatar asked Feb 19 '23 13:02

RubenGeert


1 Answers

Basically, avoid all of these. All those are inside the __builtin__ module (builtins in Python 3).

Source: The Python Standard Library » Built-in Functions.

like image 110
juliomalegria Avatar answered May 01 '23 04:05

juliomalegria