Re: [orca-list] Please help. A beginner's elementary queries on Orca source code: Query Set 1.



Dattatray Bhat <bhatdv gmail com> wrote:
 
2. Function __getattr__(self, attr), in class Word, in flat_review.py has
following assignment (line no.135-137)-
    [char, startOffset, endOffset] = text.getTextAtOffset(self.startOffset +
i, pyatspi.TEXT_BOUNDARY_CHAR)
   What does the left hand side syntactically represent? 

Three variables that will be assigned in parallel three values resulting from
the evaluation of the right-hand side of the assignment.

For example, if I write:
[a,b,c] = 2,4,6

a=2, b=4 and c=6 after the assignment.

Since the assignments occur in parallel, you can swap the values of two
variables without having to use a temporary variable:

[a,b] = b,a
works.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]