Re: [Python-Dev] Iterable String Redux (aka String ABC)

2008-05-30 Thread Steven D'Aprano
On Sat, 31 May 2008 12:48:41 am Armin Ronacher wrote: > Greg Ewing canterbury.ac.nz> writes: > > Well, I'm skeptical about the whole ABC thing in the > > first place -- it all seems very unpythonic to me. > > I think it's very pythonic and the very best solution to interfaces > *and* duck typing.

Re: [Python-Dev] optimization required: .format() is much slower than %

2008-05-30 Thread Eric Smith
Eric Smith wrote: Eric Smith wrote: Nick Coghlan wrote: Secondly, the string % operator appears to have an explicit optimisation for the 'just return str(self)' case. This optimisation is missing from the new string format method. I'll see if I can optimize this case. 3.0, from svn: $ ./py

Re: [Python-Dev] A thought on generic functions

2008-05-30 Thread Neil Toronto
Greg Ewing wrote: Paul Moore wrote: I'd rather see a solution which addressed the wider visitor use case (I think I just sprained my back bending over backwards to avoid mentioning generic functions :-)) Speaking of generic functions, while thinking about the recent discussion on proxy objects

Re: [Python-Dev] [Python-3000] Iterable String Redux (aka StringABC)

2008-05-30 Thread Jamie Gennis
Perhaps drawing a distinction between containers (or maybe "collections"?), and non-container iterables is appropriate? I would define containers as objects that can be iterated over multiple times and for which iteration does not instantiate new objects. By this definition generators would not b

Re: [Python-Dev] PEP 371 Discussion (pyProcessing Module)

2008-05-30 Thread Farshid Lashkari
On Fri, May 30, 2008 at 9:29 AM, Nick Coghlan <[EMAIL PROTECTED]> wrote: > py2exe is explicitly supported (via the freezeSupport() call). That may work > for the embedded case as well, or it may be something that can be addressed > by modifying sys.executable. Thanks for the tip Nick. Adding the f

Re: [Python-Dev] Iterable String Redux (aka String ABC)

2008-05-30 Thread Nick Coghlan
Michael Foord wrote: I would be strongly +1 on a string ABC. Currently (to my knowledge) there is no way of using duck typing for built-in APIs that expect a string. How do I pass in an object to 'open' for example that isn't actually a string or subclass? Implement the character buffer API,

Re: [Python-Dev] PEP 371 Discussion (pyProcessing Module)

2008-05-30 Thread Nick Coghlan
Thomas Heller wrote: Jesse Noller schrieb: On Fri, May 30, 2008 at 2:19 AM, Farshid Lashkari <[EMAIL PROTECTED]> wrote: On Wed, May 28, 2008 at 10:03 AM, Jesse Noller <[EMAIL PROTECTED]> wrote: I would like to renew the discussion now that "there is a PEP" to see if there are any outstanding t

Re: [Python-Dev] Iterable String Redux (aka String ABC)

2008-05-30 Thread Michael Foord
Armin Ronacher wrote: Greg Ewing canterbury.ac.nz> writes: Well, I'm skeptical about the whole ABC thing in the first place -- it all seems very unpythonic to me. I think it's very pythonic and the very best solution to interfaces *and* duck typing. Not only does it extend duck-typin

[Python-Dev] Summary of Python tracker Issues

2008-05-30 Thread Python tracker
ACTIVITY SUMMARY (05/23/08 - 05/30/08) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue number. Do NOT respond to this message. 1889 open (+35) / 12944 closed (+25) / 14833 total (+60) Open issues with patches: 566 Average

Re: [Python-Dev] Iterable String Redux (aka StringABC)

2008-05-30 Thread Ron Adam
Raymond Hettinger wrote: "Jim Jewett" It isn't really stringiness that matters, it is that you have to terminate even though you still have an iterable container. Well said. Guido had at least a start in Searchable, back when ABC were still in the sandbox: Have to disagree here. An obj

Re: [Python-Dev] Iterable String Redux (aka String ABC)

2008-05-30 Thread Armin Ronacher
Greg Ewing canterbury.ac.nz> writes: > Well, I'm skeptical about the whole ABC thing in the > first place -- it all seems very unpythonic to me. I think it's very pythonic and the very best solution to interfaces *and* duck typing. Not only does it extend duck-typing in a very, very cool way but

Re: [Python-Dev] PEP 371 Discussion (pyProcessing Module)

2008-05-30 Thread Thomas Heller
Jesse Noller schrieb: > On Fri, May 30, 2008 at 2:19 AM, Farshid Lashkari <[EMAIL PROTECTED]> wrote: >> On Wed, May 28, 2008 at 10:03 AM, Jesse Noller <[EMAIL PROTECTED]> wrote: >>> I would like to renew the discussion now that "there is a PEP" to see >>> if there are any outstanding things people

Re: [Python-Dev] PEP 371 Discussion (pyProcessing Module)

2008-05-30 Thread Jesse Noller
On Fri, May 30, 2008 at 2:19 AM, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > On Wed, May 28, 2008 at 10:03 AM, Jesse Noller <[EMAIL PROTECTED]> wrote: >> I would like to renew the discussion now that "there is a PEP" to see >> if there are any outstanding things people would like to get resolved.

Re: [Python-Dev] optimization required: .format() is much slower than %

2008-05-30 Thread Nick Coghlan
Simon Cross wrote: It struct me as odd that this one case shows such a big difference while the others show less of one. I believe the %-formatting code has some optimisations in place where it realises it can just increment the reference count of the passed in string and return that, rather

Re: [Python-Dev] [Python-3000] Stabilizing the C API of 2.6 and 3.0

2008-05-30 Thread M.-A. Lemburg
On 2008-05-30 00:57, Nick Coghlan wrote: M.-A. Lemburg wrote: * Why can't we have both PyString *and* PyBytes exposed in 2.x, with one redirecting to the other ? We do have that - the PyString_* names still work perfectly fine in 2.x. They just won't be used in the Python core codebase anymor

Re: [Python-Dev] Iterable String Redux (aka String ABC)

2008-05-30 Thread Greg Ewing
Georg Brandl wrote: Greg Ewing schrieb: A better solution to that might be to have UserString inherit from basestring. But with that argument you could throw out the whole ABC machinery, just let all lists inherit from list, all dicts from dict, etc. Well, I'm skeptical about the whole ABC

Re: [Python-Dev] [Python-3000] Stabilizing the C API of 2.6 and 3.0

2008-05-30 Thread Gregory P. Smith
On Thu, May 29, 2008 at 3:57 PM, Nick Coghlan <[EMAIL PROTECTED]> wrote: > M.-A. Lemburg wrote: >> * Why should the 2.x code base turn to hacks, just because 3.x wants >> to restructure itself ? > > With the better explanation from Greg of what the checked in approach > achieves (i.e. preserving ex

Re: [Python-Dev] Obtaining short file path

2008-05-30 Thread Ulrich Berning
Hartwell Bryan wrote: Hi, Purpose: obtaining the system (“short”) path from a full path Background: File dialogs (visual studio) return a full path (e.g. f=“C:\this path has spaces\thisfilenameislongerthan8char.txt”). If this value is provided to Python, it will not recongize this as a file