[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.217,2.218

Greg Stein gstein@lyra.org
Fri, 12 Jan 2001 02:31:53 -0800


On Thu, Jan 11, 2001 at 10:41:57PM +0100, Thomas Wouters wrote:
> On Thu, Jan 11, 2001 at 12:25:30PM -0800, Mark Hammond wrote:
> 
> > I thought rules were pretty clear with reference counting - dont assume
> > _anything_ about the object unless you hold a reference (or are damn sure
> > someone else does!)
> 
> Moshe isn't breaking that rule. He isn't assuming anything about the object,
> just about the value of the pointer to that object. I agree, though, that
> it's bad practice to rely on it having the old value, after DECREFing it.

Oh, that is just so much baloney.

If I said Py_DECREF(&ptr), *then* I'd be worried. But if I ever call
Py_DECREF(foo) and it modifies foo, then I'd be quite upset. "functions"
just aren't supposed to do that.

-g

-- 
Greg Stein, http://www.lyra.org/