From mwh at python.net Sat Aug 7 17:05:27 2004 From: mwh at python.net (Michael Hudson) Date: Sat Aug 7 17:05:28 2004 Subject: [Doc-SIG] partial rewrite of the "extending and embedding" manual Message-ID: <2mzn572dl4.fsf@starship.python.net> I've been heard before now to complain about the extending and embedding manual. Some time ago I started a rewrite, and found it again this morning ;-) I've uploaded what I have here: http://starship.python.net/crew/mwh/toext/ >From the introduction, a sort of manifesto for the document is: This document is intended to make sense when read from beginning to end and is written in a terse style with an emphasis on examples. Extreme Programming applied to documentation, if you like. Comments welcome. Feel free to be very critical of what's there, and suggestions of missing material are also welcome. I'm quite keen on the idea of it all being in one person's (i.e. mine, unless someone much more enthusiastic takes over) prose style, so I'm not particularly looking for contributions of content (but obviously can handle such, if you're prepared to see me rewrite your carefully wrought sentences :-). Cheers, mwh -- > Touche! But this confirms you are composed of logic gates. Crud, I thought those were neurons in there. -- Thomas F. Burdick, Kenny Tilton, comp.lang.lisp From mwh at python.net Tue Aug 10 17:43:41 2004 From: mwh at python.net (Michael Hudson) Date: Tue Aug 10 17:43:43 2004 Subject: [Doc-SIG] partial rewrite of the "extending and embedding" manual In-Reply-To: <2mzn572dl4.fsf@starship.python.net> (Michael Hudson's message of "Sat, 07 Aug 2004 16:05:27 +0100") References: <2mzn572dl4.fsf@starship.python.net> Message-ID: <2m3c2v0ziq.fsf@starship.python.net> Michael Hudson writes: > I've been heard before now to complain about the extending and > embedding manual. Some time ago I started a rewrite, and found it > again this morning ;-) > > I've uploaded what I have here: > > http://starship.python.net/crew/mwh/toext/ [...] > Comments welcome. Noone? Oh well... Cheers, mwh -- Finding a needle in a haystack is a lot easier if you burn down the haystack and scan the ashes with a metal detector. -- the Silicon Valley Tarot (another one nicked from David Rush) From rjkimble at alum.mit.edu Tue Aug 10 18:25:46 2004 From: rjkimble at alum.mit.edu (Bob Kimble) Date: Tue Aug 10 18:25:50 2004 Subject: [Doc-SIG] partial rewrite of the "extending and embedding" manual In-Reply-To: <2m3c2v0ziq.fsf@starship.python.net> References: <2mzn572dl4.fsf@starship.python.net> <2m3c2v0ziq.fsf@starship.python.net> Message-ID: <200408101225.46301.rjkimble@alum.mit.edu> On Tuesday 10 August 2004 11:43 am, Michael Hudson wrote: > Michael Hudson writes: > > I've been heard before now to complain about the extending and > > embedding manual. Some time ago I started a rewrite, and found it > > again this morning ;-) > > > > I've uploaded what I have here: > > > > http://starship.python.net/crew/mwh/toext/ > > [...] > > > Comments welcome. > > Noone? Oh well... > > Cheers, > mwh Sorry for not responding earlier. I went through it immediately after you posted it, and I think what you have done so far is terrific. It encouraged me to look at the Python manuals. Now all I have to do is to learn C! I found it very easy to go through your steps and generate some C extensions. There's no doubt in my mind that I could implement something simple using your manual in conjunction with "Extending and Embedding the Python Interpreter" from the Python documentation. I'd love to see you complete the work. Regards, .... Bob From fdrake at acm.org Tue Aug 10 18:37:57 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Tue Aug 10 18:38:04 2004 Subject: [Doc-SIG] partial rewrite of the "extending and embedding" manual In-Reply-To: <2m3c2v0ziq.fsf@starship.python.net> References: <2mzn572dl4.fsf@starship.python.net> <2m3c2v0ziq.fsf@starship.python.net> Message-ID: <200408101237.57748.fdrake@acm.org> On Tuesday 10 August 2004 11:43 am, Michael Hudson wrote: > Noone? Oh well... I'm not ignoring you, just way too busy right now. Feel free to remind me a couple of weeks if you haven't heard anything from me. -Fred -- Fred L. Drake, Jr. From glc at well.com Wed Aug 11 15:31:57 2004 From: glc at well.com (Greg Chapman) Date: Wed Aug 11 15:50:45 2004 Subject: [Doc-SIG] Re: partial rewrite of the "extending and embedding" manual References: <2mzn572dl4.fsf@starship.python.net> Message-ID: <6k7kh0deftvvnc0s1ecipfdvk7jt1o57ek@4ax.com> On Sat, 07 Aug 2004 16:05:27 +0100, Michael Hudson wrote: >Comments welcome. Feel free to be very critical of what's there, and >suggestions of missing material are also welcome. I'm quite keen on >the idea of it all being in one person's (i.e. mine, unless someone >much more enthusiastic takes over) prose style, so I'm not >particularly looking for contributions of content (but obviously can >handle such, if you're prepared to see me rewrite your carefully >wrought sentences :-). > There is a thinko that shows up in a couple of places: http://starship.python.net/crew/mwh/toext/node5.html : "PyArg_UnpackTuple returns 0 on success and -1 on failure." (and the following discussion). then http://starship.python.net/crew/mwh/toext/node7.html : "Attempting to pass values that cannot be implicitly converted to Python integers - strings or files, say - will result in PyArg_ParseTuple setting an exception or returning -1". Of course, all the PyArg_XXX functions return true on success and false on failure, as shown in your example code. --- Greg Chapman From mwh at python.net Wed Aug 11 15:57:41 2004 From: mwh at python.net (Michael Hudson) Date: Wed Aug 11 15:57:42 2004 Subject: [Doc-SIG] Re: partial rewrite of the "extending and embedding" manual In-Reply-To: <6k7kh0deftvvnc0s1ecipfdvk7jt1o57ek@4ax.com> (Greg Chapman's message of "Wed, 11 Aug 2004 06:31:57 -0700") References: <2mzn572dl4.fsf@starship.python.net> <6k7kh0deftvvnc0s1ecipfdvk7jt1o57ek@4ax.com> Message-ID: <2misbpzsiy.fsf@starship.python.net> Greg Chapman writes: > On Sat, 07 Aug 2004 16:05:27 +0100, Michael Hudson wrote: > >>Comments welcome. Feel free to be very critical of what's there, and >>suggestions of missing material are also welcome. I'm quite keen on >>the idea of it all being in one person's (i.e. mine, unless someone >>much more enthusiastic takes over) prose style, so I'm not >>particularly looking for contributions of content (but obviously can >>handle such, if you're prepared to see me rewrite your carefully >>wrought sentences :-). >> > > There is a thinko that shows up in a couple of places: > > http://starship.python.net/crew/mwh/toext/node5.html : > > "PyArg_UnpackTuple returns 0 on success and -1 on failure." (and the following > discussion). > > then http://starship.python.net/crew/mwh/toext/node7.html : > > "Attempting to pass values that cannot be implicitly converted to Python > integers - strings or files, say - will result in PyArg_ParseTuple setting an > exception or returning -1". > > Of course, all the PyArg_XXX functions return true on success and false on > failure, as shown in your example code. Argh, thanks. I'll fix that soon (the source is at home on the laptop). Who designed this API? . Cheers, mwh -- : Giant screaming pieces of excrement, they are. I have a feeling that some of the people in here have a MUCH more exciting time relieving themselves than I do. -- Mike Sphar & Dave Brown, asr From mwh at python.net Thu Aug 12 19:07:04 2004 From: mwh at python.net (Michael Hudson) Date: Thu Aug 12 19:07:08 2004 Subject: [Doc-SIG] partial rewrite of the "extending and embedding" manual In-Reply-To: <200408101225.46301.rjkimble@alum.mit.edu> (Bob Kimble's message of "Tue, 10 Aug 2004 12:25:46 -0400") References: <2mzn572dl4.fsf@starship.python.net> <2m3c2v0ziq.fsf@starship.python.net> <200408101225.46301.rjkimble@alum.mit.edu> Message-ID: <2my8kkxp3b.fsf@starship.python.net> Bob Kimble writes: > On Tuesday 10 August 2004 11:43 am, Michael Hudson wrote: >> Michael Hudson writes: >> > I've been heard before now to complain about the extending and >> > embedding manual. Some time ago I started a rewrite, and found it >> > again this morning ;-) >> > >> > I've uploaded what I have here: >> > >> > http://starship.python.net/crew/mwh/toext/ >> >> [...] >> >> > Comments welcome. >> >> Noone? Oh well... >> >> Cheers, >> mwh > > Sorry for not responding earlier. I went through it immediately after you > posted it, and I think what you have done so far is terrific. It encouraged > me to look at the Python manuals. Now all I have to do is to learn C! > > I found it very easy to go through your steps and generate some C > extensions. There's no doubt in my mind that I could implement > something simple using your manual in conjunction with "Extending > and Embedding the Python Interpreter" from the Python > documentation. I'd love to see you complete the work. I would be REALLY interested if you tried to implement a C extension and then told me what you ended up needing to look up in the existing Python documentation -- there's no better way to find out what I should be including in my document! Cheers, mwh -- Just getting something to work usually means writing reams of code fast, like a Stephen King novel, but making it maintainable and high-quality code that really expresses the ideas well, is like writing poetry. Art is taking away. -- Erik Naggum, comp.lang.lisp From mwh at python.net Thu Aug 12 19:14:21 2004 From: mwh at python.net (Michael Hudson) Date: Thu Aug 12 19:14:23 2004 Subject: [Doc-SIG] Re: partial rewrite of the "extending and embedding" manual In-Reply-To: <2misbpzsiy.fsf@starship.python.net> (Michael Hudson's message of "Wed, 11 Aug 2004 14:57:41 +0100") References: <2mzn572dl4.fsf@starship.python.net> <6k7kh0deftvvnc0s1ecipfdvk7jt1o57ek@4ax.com> <2misbpzsiy.fsf@starship.python.net> Message-ID: <2mu0v8xor6.fsf@starship.python.net> Michael Hudson writes: > Argh, thanks. I'll fix that soon (the source is at home on the > laptop). I've uploaded a new version, which attempts to fix the problems Greg reported and blathers on a bit more about a few things. Still at http://starhip.python.net/crew/mwh/toext/ still waiting for more grammar/accuracy/obtuseness flames. > Who designed this API? . I've found a few things to complaing about, though :-) Why ON EARTH do we have both PyObject_CallFunction and PyEval_CallFunction?? (and ..Method). The two functions do almost exactly the same thing -- the only explanation I can think of is that one of the pair got implemented by someone who realised they'd be handy but didn't realize that they already (essentially) existed! Also, PyArg_ParseTupleAndKeywords's error checking seems dubious. This is even noted in a comment in getargs.c... also, the function seems more inefficient than it really needs to be. Cheers, mwh -- I'm about to search Google for contract assassins to go to Iomega and HP's programming groups and kill everyone there with some kind of electrically charged rusty barbed thing. -- http://bofhcam.org/journal/journal.html, 2002-01-08