Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Thomas Wouters
On 3/8/07, Bill Janssen <[EMAIL PROTECTED]> wrote: There's an incomplete wiki page about a possible factoring of types at http://wiki.python.org/moin/AbstractBaseClasses. The one thing that I have been unable to figure out (from that page, the python-dev/python-3000 messages on the subject an

Re: [Python-3000] Reversing through text files with the new IO library

2007-03-12 Thread Guido van Rossum
Thanks! This is a very interesting idea, I'd like to keep this around somehow. I also see that you noticed a problem with text I/O in the current design; there's no easy way to implement readline() efficiently. I want readline() to be as efficient as possible -- "for line in " should *scream*, lik

Re: [Python-3000] generics [was: Discussions with no PEPs]

2007-03-12 Thread Guido van Rossum
Actually, I like the version with t[0]-t[1] better. This is supposed to be an exposition about groupby. Working out how it works, the version with count() seems to take more effort. But thanks for doing this! Is it done, apart from this nit? Then I'll check it in. --Guido On 3/10/07, Tony Lownds

Re: [Python-3000] Moving files around

2007-03-12 Thread Guido van Rossum
+1 for test.support too. -1 for putting code in test/__init__.py. On 3/10/07, Collin Winter <[EMAIL PROTECTED]> wrote: > On 3/10/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > [snip] > > And does anyone else find test.test_support an odd name; it isn't > > testing anything! I really want to rename

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mar 11, 2007, at 7:50 AM, Benji York wrote: > Greg Ewing wrote: >> Barry Warsaw wrote: >>> We already have an established, community accepted implementation >>> of interfaces, >> Really? Which one is that? > > I believe Barry was referring to zo

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mar 12, 2007, at 1:02 PM, Thomas Wouters wrote: > - Mixing interface-definition and implementation like that makes > it hard for new programmers to pick up the difference. It will be > harder to explain the difference between 'dict' and 'Mappi

Re: [Python-3000] __builtin__ and __builtins__

2007-03-12 Thread Guido van Rossum
This is all my fault. Long ago, there was only __builtin__, and all was well; you had to import it before using it. Then I added __builtins__ as an internal hook for restricted execution mode. The idea was that if __builtins__ was set to something nonstandard you were automatically in restricted

Re: [Python-3000] generics [was: Discussions with no PEPs]

2007-03-12 Thread Tony Lownds
On Mar 12, 2007, at 11:09 AM, Guido van Rossum wrote: > Actually, I like the version with t[0]-t[1] better. This is supposed > to be an exposition about groupby. Working out how it works, the > version with count() seems to take more effort. > > But thanks for doing this! Is it done, apart from t

Re: [Python-3000] generics [was: Discussions with no PEPs]

2007-03-12 Thread Collin Winter
On 3/12/07, Tony Lownds <[EMAIL PROTECTED]> wrote: > > On Mar 12, 2007, at 11:09 AM, Guido van Rossum wrote: > > > Actually, I like the version with t[0]-t[1] better. This is supposed > > to be an exposition about groupby. Working out how it works, the > > version with count() seems to take more ef

Re: [Python-3000] generics [was: Discussions with no PEPs]

2007-03-12 Thread Tony Lownds
On Mar 12, 2007, at 12:06 PM, Collin Winter wrote: > I can take care of it. It'll be a good excuse to get back to 2to3 > after a few days spent in the depths of the patch tracker : ) > Cool. Out of curiosity, what versions of Python should 2to3 need to run? I know that 2to3/refactor.py needs 2.3

Re: [Python-3000] generics [was: Discussions with no PEPs]

2007-03-12 Thread Collin Winter
On 3/12/07, Tony Lownds <[EMAIL PROTECTED]> wrote: > > On Mar 12, 2007, at 12:06 PM, Collin Winter wrote: > > > I can take care of it. It'll be a good excuse to get back to 2to3 > > after a few days spent in the depths of the patch tracker : ) > > > > Cool. Out of curiosity, what versions of Python

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Phillip J. Eby
At 02:14 PM 3/12/2007 -0400, Barry Warsaw wrote: >-BEGIN PGP SIGNED MESSAGE- >Hash: SHA1 > >On Mar 11, 2007, at 7:50 AM, Benji York wrote: > > > Greg Ewing wrote: > >> Barry Warsaw wrote: > >>> We already have an established, community accepted implementation > >>> of interfaces, > >> Real

Re: [Python-3000] generics [was: Discussions with no PEPs]

2007-03-12 Thread Guido van Rossum
On 3/12/07, Collin Winter <[EMAIL PROTECTED]> wrote: > On 3/12/07, Tony Lownds <[EMAIL PROTECTED]> wrote: > > > > On Mar 12, 2007, at 12:06 PM, Collin Winter wrote: > > > > > I can take care of it. It'll be a good excuse to get back to 2to3 > > > after a few days spent in the depths of the patch tr

Re: [Python-3000] Reversing through text files with the new IO library

2007-03-12 Thread Mark Russell
On 12 Mar 2007, at 17:56, Guido van Rossum wrote: > Thanks! This is a very interesting idea, I'd like to keep this > around somehow. Thanks for the positive feedback - much appreciated. > I also see that you noticed a problem with text I/O in the current > design; there's no easy way to impleme

Re: [Python-3000] Reversing through text files with the new IO library

2007-03-12 Thread Guido van Rossum
On 3/12/07, Mark Russell <[EMAIL PROTECTED]> wrote: > On 12 Mar 2007, at 17:56, Guido van Rossum wrote: > > Thanks! This is a very interesting idea, I'd like to keep this > > around somehow. > > Thanks for the positive feedback - much appreciated. > > > I also see that you noticed a problem with te

Re: [Python-3000] Reversing through text files with the new IO library

2007-03-12 Thread Mark Russell
On 12 Mar 2007, at 20:18, Guido van Rossum wrote: > I would love for you to start working on this. Let me know off-line if > you need more guidance (but CC Daniel and Mike so they know what's > going on). Great! I'll start off by working up a patch that implements any easy missing stuff from ht

Re: [Python-3000] generics [was: Discussions with no PEPs]

2007-03-12 Thread Collin Winter
On 3/12/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 3/12/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > On 3/12/07, Tony Lownds <[EMAIL PROTECTED]> wrote: > > > Cool. Out of curiosity, what versions of Python should 2to3 need to > > > run? I know that 2to3/refactor.py needs 2.3 < Python

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Guido van Rossum
On 3/12/07, Thomas Wouters <[EMAIL PROTECTED]> wrote: > > On 3/8/07, Bill Janssen <[EMAIL PROTECTED]> wrote: > > There's an incomplete wiki page about a possible factoring of types at > > http://wiki.python.org/moin/AbstractBaseClasses. > > The one thing that I have been unable to figure out (from

[Python-3000] exception info [was: Discussions with no PEPs]

2007-03-12 Thread Georg Brandl
Collin Winter schrieb: >> > > Also, since I believe sys.exc_info() is staying, fix_sysexcinfo >> > > should change... >> > >> > Right. It's already on my todo list. >> >> I must've missed that. What happened? > > I thought the decision had been made (or at least, the consensus > reached) that sys

Re: [Python-3000] exception info [was: Discussions with no PEPs]

2007-03-12 Thread Guido van Rossum
On 3/12/07, Georg Brandl <[EMAIL PROTECTED]> wrote: > Has the final decision now been made whether the traceback should be > stuck on the exception or not? If it has, I wasn't there. :-( I'm still hoping we can get agreement that storing the traceback on the exception object is the way to go. Onl

Re: [Python-3000] __builtin__ and __builtins__

2007-03-12 Thread Greg Ewing
Ka-Ping Yee wrote: > We have "import as", though. If you want to import the default > builtins without using them as the builtins, you can say > > import __builtin__ as default_builtin Seems to me it would be better to rename the module to a non-double-underscore name. There's really nothin

Re: [Python-3000] __builtin__ and __builtins__

2007-03-12 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mar 12, 2007, at 6:12 PM, Greg Ewing wrote: > Seems to me it would be better to rename the module > to a non-double-underscore name. There's really nothing > magical about the module itself, only the name used > by global variable lookups. So just

Re: [Python-3000] __builtin__ and __builtins__

2007-03-12 Thread Guido van Rossum
On 3/12/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Ka-Ping Yee wrote: > > > We have "import as", though. If you want to import the default > > builtins without using them as the builtins, you can say > > > > import __builtin__ as default_builtin > > Seems to me it would be better to rename th

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mar 12, 2007, at 3:33 PM, Phillip J. Eby wrote: > For maybe 80-90% of the purposes that I originally created > PyProtocols for, I have found that "simplegeneric" ( http:// > cheeseshop.python.org/simplegeneric/ ) is more than adequate -- and >

Re: [Python-3000] exception info [was: Discussions with no PEPs]

2007-03-12 Thread Greg Ewing
Guido van Rossum wrote: > I'm still hoping we can get agreement that storing the traceback on > the exception object is the way to go. Only a handful of modules using > pre-baked exception objects would have to be fixed, and likely those > were doing it out of a misunderstanding of the performance

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Phillip J. Eby
At 07:00 PM 3/12/2007 -0400, Barry Warsaw wrote: >-BEGIN PGP SIGNED MESSAGE- >Hash: SHA1 > >On Mar 12, 2007, at 3:33 PM, Phillip J. Eby wrote: > > > For maybe 80-90% of the purposes that I originally created > > PyProtocols for, I have found that "simplegeneric" ( http:// > > cheeseshop.pyt

Re: [Python-3000] Moving files around

2007-03-12 Thread Brett Cannon
I will go ahead and add it this to PEP 3108. -Brett On 3/12/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > +1 for test.support too. -1 for putting code in test/__init__.py. > > On 3/10/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > On 3/10/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > > [sni

Re: [Python-3000] __builtin__ and __builtins__

2007-03-12 Thread Brett Cannon
On 3/12/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 3/12/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > > Ka-Ping Yee wrote: > > > > > We have "import as", though. If you want to import the default > > > builtins without using them as the builtins, you can say > > > > > > import __builti

Re: [Python-3000] PEP for Metaclasses in Python 3000

2007-03-12 Thread Guido van Rossum
On 3/9/07, Talin <[EMAIL PROTECTED]> wrote: > I had a conversation with Guido last night at the Python user's group > meeting, and we hashed out some of the details of how metaclasses should > work. I've gone ahead and written up a PEP, which I present for your review. Executive summary: I'm defen

Re: [Python-3000] exception info [was: Discussions with no PEPs]

2007-03-12 Thread Guido van Rossum
On 3/12/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > I'm still hoping we can get agreement that storing the traceback on > > the exception object is the way to go. Only a handful of modules using > > pre-baked exception objects would have to be fixed, and likely those > >

Re: [Python-3000] exception info [was: Discussions with no PEPs]

2007-03-12 Thread Collin Winter
On 3/12/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 3/12/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > > Guido van Rossum wrote: > > > I'm still hoping we can get agreement that storing the traceback on > > > the exception object is the way to go. Only a handful of modules using > > > pre-ba

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Bill Janssen
Phillip, I think there is a certain schizophrenia in Python between the older original procedural/functional orientation (itself somewhat split), and the newer-fangled (for Python) object style, between len(obj) and obj.len(). That's what makes it hard to evaluate the pros and cons between adding

Re: [Python-3000] PEP for Metaclasses in Python 3000

2007-03-12 Thread Collin Winter
On 3/12/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: [snip stuff I agree with] > On 3/9/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > > Do the keywords have to follow the metaclass keyword, or is order > > irrelevant? While order makes sense, it would be a new precedent for > > keyword argument

Re: [Python-3000] PEP for Metaclasses in Python 3000

2007-03-12 Thread Phillip J. Eby
At 05:30 PM 3/12/2007 -0700, Guido van Rossum wrote: >I don't know about sealed, but using class attributes topassing >parameter (other than the namespace itself) to the metaclass seems a >pretty lousy mechanism, and keyword arguments in the classdef are a >much cleaner solution for this need. For

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Phillip J. Eby
At 06:06 PM 3/12/2007 -0700, Bill Janssen wrote: >Phillip, > >I think there is a certain schizophrenia in Python between the older >original procedural/functional orientation (itself somewhat split), >and the newer-fangled (for Python) object style, between len(obj) and >obj.len(). Where you see s

Re: [Python-3000] PEP for Metaclasses in Python 3000

2007-03-12 Thread Guido van Rossum
On 3/12/07, Collin Winter <[EMAIL PROTECTED]> wrote: > On 3/12/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > [snip stuff I agree with] > > On 3/9/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > > > Do the keywords have to follow the metaclass keyword, or is order > > > irrelevant? While order ma

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Benji York
Phillip J. Eby wrote: > I posted here several months ago a short "Interface" class that > used generic functions for its base How could Python use generic functions to accomplish what the proposed ABCs aim to? By first implementing interfaces? Perhaps by implementing is_file() with a generic

[Python-3000] Proposed changes to PEP3101 advanced string formatting -- please discuss and vote!

2007-03-12 Thread Patrick Maupin
Eric Smith and I have a reasonable first-cut of a C implementation for Talin's PEP3101 (it runs as an extension module and has been tested on Python 2.3, 2.4, and 3.0) along with some test cases. It's sort of experimental, in that it mostly implements the PEP, but also implements a few possible e

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Steven Bethard
On 3/12/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 02:14 PM 3/12/2007 -0400, Barry Warsaw wrote: > >The question then becomes whether we really want to invent a third > >way of doing interfaces in Python, or whether our time is better > >spent selecting and promoting one of the existing, tr

Re: [Python-3000] PEP for Metaclasses in Python 3000

2007-03-12 Thread Steven Bethard
On 3/12/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 3/9/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > > Do the keywords have to follow the metaclass keyword, or is order > > irrelevant? While order makes sense, it would be a new precedent for > > keyword arguments to have an important ord

Re: [Python-3000] PEP for Metaclasses in Python 3000

2007-03-12 Thread Terry Reedy
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] FWIW, I agree that class definition meta-information should go in the header rather that the body. To me, metaclass=mymeta at the top is much prettier than __metaclass__ = mymeta in the body. It will also make it

Re: [Python-3000] PEP for Metaclasses in Python 3000

2007-03-12 Thread Guido van Rossum
Unsure why you present this as a question; I'm not sure anyone has thought much about it yet. I wonder if the call shouldn't be made like this: __prepare__(name, bases, **kwargs) so that if you only expect certain specific keyword args you can define it like this: def __prepare__(name, base, met

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Phillip J. Eby
At 10:03 PM 3/12/2007 -0400, Benji York wrote: >Phillip J. Eby wrote: > > I posted here several months ago a short "Interface" class that > > used generic functions for its base > >How could Python use generic functions to accomplish what the proposed >ABCs aim to? Which specific aim do you have i

Re: [Python-3000] PEP for Metaclasses in Python 3000

2007-03-12 Thread Steven Bethard
On 3/12/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > the signature of the method called will be:: > __prepare__(name, args, kwargs) > not > __prepare__(name, *args, **kwargs) > right? On 3/12/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I'm not sure anyone has thought much about it

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Phillip J. Eby
At 08:48 PM 3/12/2007 -0600, Steven Bethard wrote: >On 3/12/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > For maybe 80-90% of the purposes that I originally created PyProtocols for, > > I have found that "simplegeneric" ( > > http://cheeseshop.python.org/simplegeneric/ ) is more than adequate -

Re: [Python-3000] PEP for Metaclasses in Python 3000

2007-03-12 Thread Phillip J. Eby
At 09:32 PM 3/12/2007 -0600, Steven Bethard wrote: >On 3/12/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > > the signature of the method called will be:: > > __prepare__(name, args, kwargs) > > not > > __prepare__(name, *args, **kwargs) > > right? > >On 3/12/07, Guido van Rossum <[EMAIL PR

Re: [Python-3000] Discussions with no PEPs

2007-03-12 Thread Steven Bethard
On 3/12/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 08:48 PM 3/12/2007 -0600, Steven Bethard wrote: > >On 3/12/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > > Of course, generic functions require you to say 'foo(bar)' instead of > > > 'bar.foo()' (and IIUC, that's the big sticking point

Re: [Python-3000] PEP for Metaclasses in Python 3000

2007-03-12 Thread Steven Bethard
On 3/12/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 09:32 PM 3/12/2007 -0600, Steven Bethard wrote: > >On 3/12/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > > > the signature of the method called will be:: > > > __prepare__(name, args, kwargs) > > > not > > > __prepare__(name, *arg

Re: [Python-3000] Proposed changes to PEP3101 advanced string formatting -- please discuss and vote!

2007-03-12 Thread Jerry Seutter
On 3/12/07, Patrick Maupin <[EMAIL PROTECTED]> wrote: Eric Smith and I have a reasonable first-cut of a C implementation for Talin's PEP3101 (it runs as an extension module and has been tested on Python 2.3, 2.4, and 3.0) along with some test cases. It's sort of experimental, in that it mostly