Re: [Python-Dev] Short-circuiting iterators

2005-12-06 Thread Simon Wittber
On 12/7/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > Are there any generator specific needs that are not met by the PEP 342 > implementation? Given a choice between throw(), close(), and send(), I > would have thought that all the bases have been covered. Agreed. When the new functionality

Re: [Python-Dev] Short-circuiting iterators

2005-12-06 Thread Raymond Hettinger
[Matthew F. Barnes] > > > Perhaps it would be a useful addition to the itertools > > > module then? > > > > > > itertools.interruptable(iterable) [Raymond Hettinger] > > Any real-world use cases or compelling contrived examples? [Simon Wittber] > I use something like this in the nanothr

Re: [Python-Dev] Short-circuiting iterators

2005-12-06 Thread Simon Wittber
On 12/7/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > [Matthew F. Barnes] Perhaps it would be a useful addition to the > itertools > > module then? > > > > itertools.interruptable(iterable) > > Any real-world use cases or compelling contrived examples? I use something like this in th

Re: [Python-Dev] Short-circuiting iterators

2005-12-06 Thread Raymond Hettinger
[Matthew F. Barnes] Perhaps it would be a useful addition to the itertools > module then? > > itertools.interruptable(iterable) Any real-world use cases or compelling contrived examples? ISTM, that the code calling it.stop() would already be in position to break-out of the iteration dir

Re: [Python-Dev] Documentation about Python's GC, python-dev list messages referenced in Modules/gcmodule.c not reachable anymore

2005-12-06 Thread Tim Peters
[Tim Peters] > ... > For example, after > >def f(): >dummy = xrange(1000) > >f() > > it's not just the `dummy` list object that's reclaimed when f exits, > it's also about 10 million integer objects. Sorry, that example should have used "range" instead of "xrange". Using xrang

Re: [Python-Dev] Documentation about Python's GC, python-dev list messages referenced in Modules/gcmodule.c not reachable anymore

2005-12-06 Thread Tim Peters
[Weber, Gregoire] >> We're seriously evaluating Python for use in embedded realtime systems >> and need some informations about Pythons garbage collector. ... [Neil Schemenauer] > It does not run in the background. One option would be to disable > the cyclic garbage collector and rely on the refe

Re: [Python-Dev] ast-objects branch created

2005-12-06 Thread Martin v. Löwis
Nick Coghlan wrote: > As Fredrik pointed out a while back, the PyObject approach doesn't *have* to > involve manual decref operations - PyObject's come with a ready made arena > structure, in the form of PyList. That doesn't really work: PyList_Append (which you would have to use) duplicates th

Re: [Python-Dev] Documentation about Python's GC, python-dev list messages referenced in Modules/gcmodule.c not reachable anymore

2005-12-06 Thread Neil Schemenauer
On Tue, Dec 06, 2005 at 11:20:46AM +0100, Weber, Gregoire wrote: > We're seriously evaluating Python for use in embedded realtime systems > and need some informations about Pythons garbage collector. > > What we're interested mostly in the runtime behaviour of the GC. The > main question is: > >

[Python-Dev] c.l.p post on docs

2005-12-06 Thread A.M. Kuchling
I just posted a lengthy message to comp.lang.python/python-list about Python's docs; the title is "Documentation suggestions". A short summary of the post is: "The RefGuide is hard to read and hard to keep updated. Do we need a friendly language description? If we do that, should the existing Re

Re: [Python-Dev] [Python-checkins] commit of r41586 - in python/trunk: Lib/SimpleXMLRPCServer.py Misc/NEWS

2005-12-06 Thread A.M. Kuchling
On Tue, Dec 06, 2005 at 07:47:06AM -0800, Guido van Rossum wrote: > Happened to see this commit. What's the magic about 10MB? Is there any > understanding of what causes it to fail? What is the failure mode? > Could it just be fragmentation causing the malloc or realloc to fail? > Should we perhaps

Re: [Python-Dev] [Python-checkins] commit of r41586 - in python/trunk: Lib/SimpleXMLRPCServer.py Misc/NEWS

2005-12-06 Thread M.-A. Lemburg
Guido van Rossum wrote: > Happened to see this commit. What's the magic about 10MB? Is there any > understanding of what causes it to fail? What is the failure mode? > Could it just be fragmentation causing the malloc or realloc to fail? > Should we perhaps use a more conservative buffer size, e.g.

Re: [Python-Dev] [Python-checkins] commit of r41586 - in python/trunk: Lib/SimpleXMLRPCServer.py Misc/NEWS

2005-12-06 Thread Guido van Rossum
Happened to see this commit. What's the magic about 10MB? Is there any understanding of what causes it to fail? What is the failure mode? Could it just be fragmentation causing the malloc or realloc to fail? Should we perhaps use a more conservative buffer size, e.g. 1MB or even 8K (the internation

Re: [Python-Dev] ast-objects branch created

2005-12-06 Thread Nick Coghlan
Neal Norwitz wrote: > This is my understanding of the two approaches from what I've seen so > far (Jeremy or Martin should correct me if I'm wrong). > > With current arena impl: > * need to call PyArena_AddPyObject() for any allocated PyObject > * need to call PyArena_AddMallocPointer() for any