python assignment

David Bolen db3l at fitlinxx.com
Wed Jul 23 12:14:29 EDT 2003


danbmil99 at yahoo.com (dan) writes:

> see my prev. post on this.  I realize my original assumptions were off
> base, but frankly the documentation does a poor job (really no job) of
> describing the state of affairs wrt how Python handles objects, and
> how this affects what happens when you assign things.  A section on
> names and binding principles would be much appreciated.

>From seeing the examples you are using, it seems to me that your issue
is much less with Python's object handling, or assignments/name
binding, but is really focused on the augmented assignment operators.

Perhaps the issue is that the documentation could be clearer that such
operators (thus the term "augmented") are not simply assignment
operators, but as Tim points out, syntactic sugar for a special method
call providing the possibility for differing behavior among different
object types (as would be true with any method call).  If you think of
them that way (as opposed to trying to keep them logically with
assignment statements) then perhaps things would seem more consistent.

-- David




More information about the Python-list mailing list