Shortcut operators (was Re: [MATRIX-SIG] random number generat or?)

Zane C. Motteler motteler@laura.llnl.gov
Wed, 29 Oct 1997 12:25:03 -0800 (PST)


Just a quick response to Perry Stool's example,

self.obj_list[self.obj_offset].count = self.obj_list[self.obj_offst].count + 1

It is only necessary to type something like self.obj_list[self.obj_offset].count
once. Don't we all have a mouse and "copy/paste" capability? There are
ways to obviate all that typing. Also, it is possible in Python to alias
complicated expressions and possibly give them more easily readable
names, e. g.

current_object = self.obj_list[self.obj_offset]

Incidentally, I "moused" all of the above expressions, didn't type them.

Cheers

Zane

-----------------------------------------------------------------------------
Zane C. Motteler, Ph. D.                  ___________ALSO:_________________
Computer Scientist                        | Professor Emeritus of Computer|
Lawrence Livermore National Laboratory    |   Science and Engineering     |
P O Box 808, L-472                        | California Polytechnic State  |
Livermore, CA 94551-9900                  |   University, San Luis Obispo |
510/423-2143                              ---------------------------------
FAX 510/423-9969
zcm@llnl.gov or motteler@laura.llnl.gov or zmottel@calpoly.edu


_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________