Re: [Python-Dev] Reference counting when entering and exiting scopes

2005-04-21 Thread Brett C.
Guido van Rossum wrote: >>So the two things I thought were glitches are actually cancelling each >>other out. Very good. Thanks for your help. > > > Though I wonder why it was written so delicately. Don't know; Jeremy wrote those functions back in 2001 to add nested scopes. If he remembers he

Re: [Python-Dev] Reference counting when entering and exiting scopes

2005-04-21 Thread Guido van Rossum
> So the two things I thought were glitches are actually cancelling each > other out. Very good. Thanks for your help. Though I wonder why it was written so delicately. Would explicit INCREF/DECREF really have hurt the performance that much? This is only the bytecode compiler, which isn't on the

Re: [Python-Dev] Reference counting when entering and exiting scopes

2005-04-21 Thread Matthew F. Barnes
On Wed, 2005-04-20 at 18:59 -0700, Brett C. wrote: > So no leak. Yes, there should be more explicit refcounting to be proper, but > the compiler cheats in a couple of places for various reasons. But basically > everything is fine since st->st_cur and st->st_stack are only played with > refcount-w

Re: [Python-Dev] Reference counting when entering and exiting scopes

2005-04-20 Thread Brett C.
Matthew F. Barnes wrote: > Someone on python-help suggested that I forward this question to > python-dev. > > I've been studying Python's core compiler and bytecode interpreter as a > model for my own interpreted language, Might want to take a peek at the AST branch in CVS; that is what the compi