25 Apr
2005
25 Apr
'05
10:30 p.m.
Robert Brewer wrote:
I still prefer more methods, because my actual use-cases are more complicated. Your solution would work for the specific case I gave, but try factoring in:
* A subclass which needs to share locals between begin and post, instead of pre and post.
or
* A set of 10 subclasses which need the same begin() but different end() code.
Yielding seems both too restrictive and too inside-out to be readable, IMO.
Ok, that makes sense. However, one of your examples seemingly pulls a name, 'old_children', out of nowhere. That's hard to fix. One of the greatest features of Python is the simple name scoping; we can't lose that. Shane