Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Michael Hoffman
On Sun, 26 Jun 2005, Phillip J. Eby wrote: At 08:19 PM 6/26/2005 +0100, Michael Hoffman wrote: On Sun, 26 Jun 2005, Phillip J. Eby wrote: * drop getcwd(); it makes no sense on a path instance Personally I use path.getcwd() as a class method all the time. It makes as much sense as

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Reinhold Birkenfeld
Michael Hoffman wrote: On Sun, 26 Jun 2005, Phillip J. Eby wrote: At 08:19 PM 6/26/2005 +0100, Michael Hoffman wrote: On Sun, 26 Jun 2005, Phillip J. Eby wrote: * drop getcwd(); it makes no sense on a path instance Personally I use path.getcwd() as a class method all the time. It makes

Re: [Python-Dev] Some RFE for review

2005-06-27 Thread Nick Coghlan
Reinhold Birkenfeld wrote: 1152248: In order to read records separated by something other than newline, file objects should either support an additional parameter (the separator) to (x)readlines(), or gain an additional method which does this. Review: The former is a no-go, I think,

Re: [Python-Dev] Some RFE for review

2005-06-27 Thread Paul Moore
On 6/27/05, Nick Coghlan [EMAIL PROTECTED] wrote: As Douglas Alan's sample implementation (and his second attempt [1]) show, getting this right (and reasonably efficient) is actually a non-trivial exercise. Leveraging the existing xreadlines infrastructure is an idea worth considering. I

Re: [Python-Dev] Some RFE for review

2005-06-27 Thread Raymond Hettinger
[Paul Moore on readline getting a record separator argument] As a more general approach, would it be worth considering an addition to itertools which took an iterator which generated blocks of items, and split them on a subsequence? Nope. Assign responsibility to the class that has all of

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Phillip J. Eby
At 08:20 AM 6/27/2005 +0100, Michael Hoffman wrote: os.getcwd() returns a string, but path.getcwd() returns a new path object. In that case, I'd expect it to be 'path.fromcwd()' or 'path.cwd()'; i.e. a constructor classmethod by analogy with 'dict.fromkeys()' or 'datetime.now()'. 'getcwd()'

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Reinhold Birkenfeld
Phillip J. Eby wrote: At 08:20 AM 6/27/2005 +0100, Michael Hoffman wrote: os.getcwd() returns a string, but path.getcwd() returns a new path object. In that case, I'd expect it to be 'path.fromcwd()' or 'path.cwd()'; i.e. a constructor classmethod by analogy with 'dict.fromkeys()' or

Re: [Python-Dev] subprocess.call() and stdin

2005-06-27 Thread Michael Chermside
Stuart Bishop writes: When I invoke subprocess.call(), I often want to ensure that the subprocess' stdin is closed. This ensures it will die if the subprocess attempts to read from stdin rather than block. This could be done if the subprocess.call() helper closes the input if

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Phillip J. Eby
At 05:10 PM 6/27/2005 +0200, Reinhold Birkenfeld wrote: Phillip J. Eby wrote: At 08:20 AM 6/27/2005 +0100, Michael Hoffman wrote: os.getcwd() returns a string, but path.getcwd() returns a new path object. In that case, I'd expect it to be 'path.fromcwd()' or 'path.cwd()'; i.e. a

[Python-Dev] Possible C API problem?

2005-06-27 Thread Gary Robinson
Hello, I was asking about a problem I was having over on the C++-python list, and they suggested I report it here as a possible Python problem. I was getting bus errors with a C module I was linking to, so factored it down too a very small example that reproduced the problem. Here it is:

Re: [Python-Dev] Decimal floats as default (was: discussion aboutPEP239 and 240)

2005-06-27 Thread Michael Chermside
Fredrik Johansson writes: In either case, compatibility can be ensured by allowing both n-digit decimal and hardware binary precision for floats, settable via a float context. Perhaps you can show me a design (or working code) that proves me wrong, but I don't believe that such a design could

Re: [Python-Dev] Some RFE for review

2005-06-27 Thread Oren Tirosh
On 6/27/05, Nick Coghlan [EMAIL PROTECTED] wrote: Reinhold Birkenfeld wrote: 1152248: In order to read records separated by something other than newline, file objects should either support an additional parameter (the separator) to (x)readlines(), or gain an additional method which

Re: [Python-Dev] Decimal floats as default (was: discussion aboutPEP239 and 240)

2005-06-27 Thread Aahz
On Mon, Jun 27, 2005, Michael Chermside wrote: If, by this, you mean adding a binary float context modeled after the Decimal float context and providing access to the underlying FP flags and traps and generally enhancing the use of binary FP, then I think it's a great idea. It's probably

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Trent Mick
os.getcwd() returns a string, but path.getcwd() returns a new path object. In that case, I'd expect it to be 'path.fromcwd()' or 'path.cwd()'; i.e. a constructor classmethod by analogy with 'dict.fromkeys()' or 'datetime.now()'. 'getcwd()' looks like it's getting a property of a path

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Walter Dörwald
Phillip J. Eby wrote: At 09:26 PM 6/26/2005 -0400, Bob Ippolito wrote: On Jun 26, 2005, at 8:54 PM, Phillip J. Eby wrote: At 12:22 AM 6/27/2005 +0200, Dörwald Walter wrote: Phillip J. Eby wrote: I'm also not keen on the fact that it makes certain things properties whose value can change

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Phillip J. Eby
At 08:24 PM 6/27/2005 +0100, Michael Hoffman wrote: On Mon, 27 Jun 2005, Phillip J. Eby wrote: At 08:20 AM 6/27/2005 +0100, Michael Hoffman wrote: os.getcwd() returns a string, but path.getcwd() returns a new path object. In that case, I'd expect it to be 'path.fromcwd()' or

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Skip Montanaro
We're getting enough discussion about various aspects of Jason's path module that perhaps a PEP is warranted. All this discussion on python-dev is just going to get lost. Skip ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Possible C API problem?

2005-06-27 Thread Michael Hudson
Gary Robinson [EMAIL PROTECTED] writes: That caused a bus error 100% of the time when I simply imported the module into Python and called getSumChiSquare(), i.e.: import testfloat testfloat.getSumChiSquare() It doesn't for me (CVS HEAD, OS X Panther). Could it be that this is a python

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Phillip J. Eby
At 03:45 PM 6/27/2005 -0500, Skip Montanaro wrote: We're getting enough discussion about various aspects of Jason's path module that perhaps a PEP is warranted. All this discussion on python-dev is just going to get lost. AFAICT, the only unresolved issue outstanding is a compromise or

Re: [Python-Dev] Possible C API problem?

2005-06-27 Thread Scott David Daniels
Michael Hudson wrote: Gary Robinson [EMAIL PROTECTED] writes: ... bus error 100% of the time ...: We've boiled it down pretty far, and I've sent him off to the mac-python folks (looks gcc-compilerish to me, or maybe fallout from slight changes in C function call semantics). --Scott David

Re: [Python-Dev] Some RFE for review

2005-06-27 Thread Nick Coghlan
Oren Tirosh wrote: An infrastructure that could be leveraged is the readahead buffer used by the file object's line iterator. That's the infrastructure I meant. I was just being sloppy with my terminology ;) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia

Re: [Python-Dev] Possible C API problem?

2005-06-27 Thread Gary Robinson
It doesn't for me (CVS HEAD, OS X Panther). Note sure what you mean CVS HEAD, you mean the latest python from cvs? 2.4? I'm still using the Apple python, which is straight 2.3. Have you, you know, tried to debug the situation yourself? If you have gcc installed, you probably have gdb

Re: [Python-Dev] Possible C API problem?

2005-06-27 Thread Delaney, Timothy (Tim)
Gary Robinson wrote: It's been around 7 years since I've used C, I've forgotten virtually everything I may have known about gdb, I've never worked with the C-python API before... meanwhile there is intense time pressure to get the next release of our product (http://www.goombah.com) ready. So

Re: [Python-Dev] Possible C API problem?

2005-06-27 Thread Bob Ippolito
On Jun 27, 2005, at 6:48 PM, Delaney, Timothy (Tim) wrote: Gary Robinson wrote: It's been around 7 years since I've used C, I've forgotten virtually everything I may have known about gdb, I've never worked with the C-python API before... meanwhile there is intense time pressure to get

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Donovan Baarda
On Mon, 2005-06-27 at 14:25, Phillip J. Eby wrote: [...] As for the open issues, if we can't reach some sane compromise about atime/ctime/mtime, I'd suggest just providing the stat() method and let people use stat().st_mtime et al. Alternately, I'd be okay with creating last_modified(),

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-06-27 Thread Neil Hodgson
Andrew Durdin: While we'ew discussing outstanding issues: In a related discussion of the path module on c.l.py, Thomas Heller pointed out that the path module doesn't correctly handle unicode paths: ... Here is a patch that avoids failure when paths can not be represented in a single 8