Augmented assignment (ie. += and friends) for Python!
Pete Shinners
pshinners at mediaone.net
Sun May 14 00:13:05 EDT 2000
> > No, he didn't, because he knows they're spelt "&=" and "|=" and he
> > supports them. Maybe you should check these things before posting?
>
> Possibly. Puzzled, however, what someone could possibly mean by &&=?
heh, & and | or the 'C' bitwise AND and OR operators. these are
handy for adding and stripping values from a bit flags value
windowStyle |= WS_VISIBLE;
windowStyle &= ~WS_MAXIMIZED;
that sort of thing in C.
just my penny, but i highly vote for these assignment variables
also. i think the code is a lot prettier with the += cousins.
heck, if i could do 'VAR += 1', instead of 'VAR = VAR + 1' i
could even do without the '++' increment style operators
More information about the Python-list
mailing list