Re: [Python-Dev] [AST] question about marshal_write_*() fxns

2005-03-21 Thread Nick Coghlan
Brett C. wrote: For those of you who don't know, I am sprinting on the AST branch here on PyCon. Ah, so that's why it's quiet this week :) But one of things I am not sure of is what the marshal_write_*() functions in Python/Python-ast.c are used for. I assume they output to the marshal format,

Re: [Python-Dev] [AST] Procedure for AST Branch patches

2005-03-21 Thread Nick Coghlan
Brett C. wrote: OK, thanks to John Ehresman here at PyCon sprint I got logistix's patch applied. Beyond a warning that a warning that decode_unicode() is never called and the parser module failing to compile under Windows everything should be fine for compiling the AST branch. Under Linux (Suse

Re: [Python-Dev] Patch review: all webbrowser.py related patches up to 2005-03-20

2005-03-21 Thread Greg Ward
On 20 March 2005, [EMAIL PROTECTED] said: > 1166780 Fix _tryorder in webbrowser.py > --- > > This is my own patch. > > At the present time (Py2.4) documentation says: > """ > Under Unix, if the environment variable BROWSER exists, > it is i

Re: [Python-Dev] Draft PEP to make file objects support non-blocking mode.

2005-03-21 Thread Donovan Baarda
On Mon, 2005-03-21 at 23:31 +1100, Donovan Baarda wrote: > On Mon, 2005-03-21 at 11:42 +0100, Peter Astrand wrote: > > On Mon, 21 Mar 2005, Donovan Baarda wrote: > > > > > > > The only ways to ensure that a select process does not block like > > > > > this, > > > > > without using non-blocking mo

Re: [Python-Dev] Draft PEP to make file objects support non-blocking mode.

2005-03-21 Thread Donovan Baarda
On Tue, 2005-03-22 at 12:49 +1200, Greg Ewing wrote: > Donovan Baarda wrote: > > > Consider the following. This is pretty much the only way you can use > > popen2 reliably without knowing specific behaviours of the executed > > command; > > > > ... > > fcntl.fcntl(child_in, fcntl.F_SETFL, flag

Re: [Python-Dev] Draft PEP to make file objects support non-blocking mode.

2005-03-21 Thread Greg Ewing
Donovan Baarda wrote: On Mon, 2005-03-21 at 17:32 +1200, Greg Ewing wrote: I don't agree with that. There's no need to use non-blocking I/O when using select(), and in fact things are less confusing if you don't. Because staller.py outputs and flushes a fragment of data smaller than selector.py use

Re: [Python-Dev] Draft PEP to make file objects support non-blocking mode.

2005-03-21 Thread Greg Ewing
Donovan Baarda wrote: Consider the following. This is pretty much the only way you can use popen2 reliably without knowing specific behaviours of the executed command; > ... fcntl.fcntl(child_in, fcntl.F_SETFL, flags | os.O_NONBLOCK) # \ ... # / fcntl.fcntl(child_out,

Re: [Python-Dev] docstring before function declaration

2005-03-21 Thread Greg Ewing
Nicholas Jacobson wrote: If a programmer wanted a docstring for the function but not the module, a blank first line would do the trick. A docstring for the module but not the function? Put a blank line between the module's docstring and the function. -1 on all this making of blank lines significa

[Python-Dev] Deprecating 2.2 old bugs

2005-03-21 Thread Facundo Batista
Going on with the old bugs checking, here are the results for 2.2. When I'll finish this will be put in an informational PEP. When I verified the bug, I filled two fields: - Summary: the same subject as in SF - Group: the bug's group at verifying time. - Bug #: the bug number - Verified: is the d

Re: [Python-Dev] [AST] Procedure for AST Branch patches

2005-03-21 Thread Brett C.
Grant Olson wrote: Make sure "AST" is used in the subject line; e.g., "[AST]" at the beginning. Unfortunately the AST group is only available for patches; not listed for bug reports (don't know why; can this be fixed?). Other than that, just assign it to me since I will most likely be doin

Re: [Python-Dev] [AST] question about marshal_write_*() fxns

2005-03-21 Thread Brett C.
Neil Schemenauer wrote: On Mon, Mar 21, 2005 at 11:53:04AM -0500, Brett C. wrote: But one of things I am not sure of is what the marshal_write_*() functions in Python/Python-ast.c are used for. I assume they output to the marshal format, but there is mention of a byte stream format and so I thou

[Python-Dev] Re: docstring before function declaration

2005-03-21 Thread Scott David Daniels
Brett C. wrote: I am going to be -42 on this one. I personally love having the docstring below the definition line I can't really rationalize > it beyond just aesthetics at the moment I completely agree that the current form is better. It reduces the temptation to use boilerplate docstr

Re: [Python-Dev] [AST] question about marshal_write_*() fxns

2005-03-21 Thread Neil Schemenauer
On Mon, Mar 21, 2005 at 11:53:04AM -0500, Brett C. wrote: > But one of things I am not sure of is what the marshal_write_*() functions > in Python/Python-ast.c are used for. I assume they output to the marshal > format, but there is mention of a byte stream format and so I thought it > might be

[Python-Dev] [AST] question about marshal_write_*() fxns

2005-03-21 Thread Brett C.
For those of you who don't know, I am sprinting on the AST branch here on PyCon. Specifically, I am fleshing out Python/compile.txt so that it can act as a good intro to new users and as a design doc. But one of things I am not sure of is what the marshal_write_*() functions in Python/Python-a

[Python-Dev] distutils/PyPI package metadata fields

2005-03-21 Thread Fred L. Drake, Jr.
On Monday 21 March 2005 10:08, Thomas Heller wrote: > I'm not sure where I should post this, but shouldn't there be a way to > specify the encoding of the metadata? There are people (not me, > fortunately), with umlauts in their names, for example. Agreed. I think there are a number of additi

Re: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/distutils/tests test_dist.py, 1.1, 1.2

2005-03-21 Thread Jeremy Hylton
On Mon, 21 Mar 2005 16:08:57 +0100, Thomas Heller <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > > PEP 314 implementation (client side): > > I'm not sure where I should post this, but shouldn't there be a way to > specify the encoding of the metadata? There are people (not me, > fort

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib/distutils/tests test_dist.py, 1.1, 1.2

2005-03-21 Thread Thomas Heller
[EMAIL PROTECTED] writes: > PEP 314 implementation (client side): I'm not sure where I should post this, but shouldn't there be a way to specify the encoding of the metadata? There are people (not me, fortunately), with umlauts in their names, for example. Thomas __

[Python-Dev] [AST] A somewhat less trivial patch than the last one. . .

2005-03-21 Thread Nick Coghlan
I've put a first cut at generator expressions for the AST branch on Sourceforge. It's enough to get test_grammar to pass, and tinkering at the interactive prompt appears to work. The patch also fixes a problem with displaying interim results for functions entered at the interactive prompt (I no

Fwd: [Python-Dev] docstring before function declaration

2005-03-21 Thread Eric Nieuwland
Nicholas Jacobson wrote: IIRC, Guido once mentioned that he regretted not setting function docstrings to come before the function declaration line, instead of after. [ examples deleted ] I think that commenting the function before its declaration, at the same tabbed point, increases the code's read

Re: [Python-Dev] docstring before function declaration

2005-03-21 Thread Brett C.
Nicholas Jacobson wrote: IIRC, Guido once mentioned that he regretted not setting function docstrings to come before the function declaration line, instead of after. He did, but I don't know how strong that regret is. i.e. """This describes class Bar.""" class Bar: ... Or with a decorator: """This

Re: [Python-Dev] docstring before function declaration

2005-03-21 Thread Anthony Baxter
On Monday 21 March 2005 20:08, Nicholas Jacobson wrote: > > How do you distinguish between a docstring at the > > top of a module > > that's immediately followed by a function? Is it > > the module docstring > > or the function docstring? > > It's both. The docstring would be assigned to both > t

Re: [Python-Dev] Draft PEP to make file objects support non-blocking mode.

2005-03-21 Thread Paul Moore
On Mon, 21 Mar 2005 17:32:36 +1200, Greg Ewing <[EMAIL PROTECTED]> wrote: > > On 18 March 2005, Donovan Baarda said: > >>The read method's current behaviour needs to be documented, so its actual > >>behaviour can be used to differentiate between an empty non-blocking read, > >>and EOF. This means

Re: [Python-Dev] Draft PEP to make file objects support non-blocking mode.

2005-03-21 Thread Donovan Baarda
On Mon, 2005-03-21 at 11:42 +0100, Peter Astrand wrote: > On Mon, 21 Mar 2005, Donovan Baarda wrote: > > > > > The only ways to ensure that a select process does not block like this, > > > > without using non-blocking mode, are; > > > > 3) Use os.read / os.write. > > [...] > > > > but os.read / o

Re: [Python-Dev] Draft PEP to make file objects support non-blocking mode.

2005-03-21 Thread Peter Astrand
On Mon, 21 Mar 2005, Donovan Baarda wrote: > > > The only ways to ensure that a select process does not block like this, > > > without using non-blocking mode, are; > > 3) Use os.read / os.write. > [...] > > but os.read / os.write will block too. No. >Try it... replace the file > read/writes in

Re: [Python-Dev] Draft PEP to make file objects support non-blockingmode.

2005-03-21 Thread Donovan Baarda
G'day, From: "Greg Ward" <[EMAIL PROTECTED]> > On 18 March 2005, Donovan Baarda said: [...] > > Currently the built in file type does not support non-blocking mode very > > well. Setting a file into non-blocking mode and reading or writing to it > > can only be done reliably by operating on the f

Re: [Python-Dev] Draft PEP to make file objects support non-blocking mode.

2005-03-21 Thread Donovan Baarda
G'day, From: "Peter Astrand" <[EMAIL PROTECTED]> > On Mon, 21 Mar 2005, Donovan Baarda wrote: [...] > This is no "trap". When select() indicates that you can write or read, it > means that you can write or read at least one byte. The .read() and > .write() file methods, however, always writes and

Re: [Python-Dev] docstring before function declaration

2005-03-21 Thread Nicholas Jacobson
Rule #1: If the docstring is the first line of a module, it's the module's docstring. Rule #2: If the docstring comes right before a class/function, it's that class/function's docstring. > How do you distinguish between a docstring at the > top of a module > that's immediately followed by a fun

Re: [Python-Dev] Draft PEP to make file objects support non-blocking mode.

2005-03-21 Thread Peter Astrand
On Mon, 21 Mar 2005, Donovan Baarda wrote: > > I don't agree with that. There's no need to use non-blocking > > I/O when using select(), and in fact things are less confusing > > if you don't. > > You would think that... and the fact that select, popen2 etc all use > file objects encourage you to

Re: [Python-Dev] Draft PEP to make file objects support non-blocking mode.

2005-03-21 Thread Donovan Baarda
On Mon, 2005-03-21 at 17:32 +1200, Greg Ewing wrote: > > On 18 March 2005, Donovan Baarda said: > > >>Many Python library methods and classes like select.select(), os.popen2(), > >>and subprocess.Popen() return and/or operate on builtin file objects. > >>However even simple applications of these m