forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMismatchInMultipleAssignment.qhelp
More file actions
35 lines (26 loc) · 1.12 KB
/
MismatchInMultipleAssignment.qhelp
File metadata and controls
35 lines (26 loc) · 1.12 KB
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
31
32
33
34
35
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p> An assignment statement evaluates a sequence expression and assigns each item of the sequence to
one of the variables on the left. If there is a mismatch between the number of variables on
the left and the values in the sequence on the right of the statement, then an exception is raised
at runtime.
</p>
</overview>
<recommendation>
<p>Ensure that the number of variables on either side of the assignment match.</p>
</recommendation>
<example>
<p>The following examples show a simple definition of the Fibonacci series. In the first example,
one of the values in the assignment has been duplicated, causing an exception at runtime.</p>
<sample src="MismatchInMultipleAssignment.py" />
</example>
<references>
<li>Python Language Reference: <a href="http://docs.python.org/2/reference/simple_stmts.html#grammar-token-assignment_stmt">
Assignment statements</a>.</li>
<li>Python Tutorial: <a href="http://docs.python.org/2/tutorial/introduction.html#first-steps-towards-programming">
First steps towards programming</a>.</li>
</references>
</qhelp>