pitfall for your amusement
Michael Hudson
mwh at python.net
Wed Nov 13 06:07:09 EST 2002
Brian Quinlan <brian at sweetapp.com> writes:
> I don't like the augmented operations because, depending on the object,
> the operation may or may not be done in-place.
I can't actually think of the last time I used augmented assignment on
something that wasn't an integer (or maybe a number).
> I think that it is better to be explicit and use assignment or method
> call. That way you know what you are getting.
Certainly I'd write
alist.extend(another)
over
alist += another
Seems to be an unnecessary -- maybe even unwise -- bit of polymorphism.
Cheers,
M.
--
Or here's an even simpler indicator of how much C++ sucks: Print
out the C++ Public Review Document. Have someone hold it about
three feet above your head and then drop it. Thus you will be
enlightened. -- Thant Tessman
More information about the Python-list
mailing list