forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShadowBuiltin.qhelp
More file actions
30 lines (22 loc) · 814 Bytes
/
ShadowBuiltin.qhelp
File metadata and controls
30 lines (22 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>When a local variable is defined with the same name as a built-in type or function, the local
variable "shadows" or "hides" the built-in object. This can lead to
confusion as a reader of the code may expect the variable to refer to a built-in object.
</p>
</overview>
<recommendation>
<p>Change the name of the local variable so that it no longer matches the name of a built-in object.
</p>
</recommendation>
<example>
<sample src="ShadowBuiltin.py" />
</example>
<references>
<li>Python Standard Library: <a href="http://docs.python.org/2/library/functions.html">Built-in Functions</a>,
<a href="http://docs.python.org/2/library/stdtypes.html">Built-in Types</a>.</li>
</references>
</qhelp>