[PEP 203] Augmented Assignment
Thomas Wouters
thomas at xs4all.net
Mon Aug 14 16:50:07 EDT 2000
On Mon, Aug 14, 2000 at 06:36:21PM +0000, Aahz Maruch wrote:
> There are a number of typos; I'm correcting those in-line.
Thanx. I've incorporated your and Bjorn Pettersen's corrections.
> My biggest question has to do with the requirement to INCREF() the
> returned object in extensions; I'm assuming that Python internally does a
> DECREF() because the variable has been "assigned" to a new object?
Yes. Python doesn't care whether the object returned is a new object or an
old one, so it always DECREFs the object. It could conceivably check if the
object is the same, and only DECREF the old object if it isn't the same, but
that would mean the functions it calls need to sometimes return a borrowed
reference, and sometimes a new reference. Ugly.
Thanx for the feedback ;)
--
Thomas Wouters <thomas at xs4all.net>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
More information about the Python-list
mailing list