Re: [Python-3000] PEP 3129: Class Decorators

2007-05-08 Thread Jack Diederich
On Mon, May 07, 2007 at 11:12:40AM -0700, Guido van Rossum wrote: > On 5/7/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > Can I go ahead and mark PEP 3129 as "accepted"? > > Almost. I'm ok with it, but I think that to follow the procedure you > ought to post the full text at least once on python

Re: [Python-3000] Question about PEP 3001 and fixing API flaws

2007-03-22 Thread Jack Diederich
On Wed, Mar 21, 2007 at 01:38:32PM -0600, Steven Bethard wrote: > On 3/14/07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > > For another example, take the Telnet class in the telnetlib module. It > > has a method set_option_negotiation_callback() which takes a function > > that will be called for e

Re: [Python-3000] Metaclasses in Python 3000: Draft 2

2007-03-14 Thread Jack Diederich
On Wed, Mar 14, 2007 at 12:29:09AM -0700, Talin wrote: > # The metaclass > class OrderedClass(type): > > # The custom dictionary > class member_table(dict): I would move the member_table class out of the OrderedClass namespace so no one gets any funny ideas that it ha

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

2007-03-14 Thread Jack Diederich
s, **kwds) cls = meta.__new__(name, bases, mydict, **kwds) meta.__init__(cls, name, bases, mydict, **kwds) A = cls > On 3/9/07, Jack Diederich <[EMAIL PROTECTED]> wrote: > > I am a very big fan of ordered dicts in classes. > > Would you mind showing us some of your u

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

2007-03-10 Thread Jack Diederich
On Sat, Mar 10, 2007 at 10:26:09AM +0100, Georg Brandl wrote: > Tony Lownds schrieb: > > >>> or fixing the assertion failure currently in CVS. > >> > >> Perhaps you should switch to SVN? :-) > > > > Heh, clearly I am behind the times. I should switch to Mercurial > > to get ahead of the curve. >

Re: [Python-3000] PEP Draft: Class Decorators

2007-03-09 Thread Jack Diederich
On Fri, Mar 09, 2007 at 06:19:49PM -0600, Collin Winter wrote: > >History and Implementation > >== > > > >Class decorators were originally proposed alongside function decorators > >in PEP318 [1]_ and were rejected by Guido [2]_ for lack of use cases. > >Two years later he sa

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

2007-03-09 Thread Jack Diederich
On Fri, Mar 09, 2007 at 12:44:36PM -0800, Talin 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. > --

Re: [Python-3000] PEP Draft: Class Decorators

2007-03-09 Thread Jack Diederich
; responses too. I'm cc'ing [EMAIL PROTECTED] for a number assignment (or can I just check it in myself?) PEP: 3XXX Title: Class Decorators Version: 1 Last-Modified: 28-Feb-2007 Authors: Jack Diederich Implementation: SF#1671208 Status: Draft Type: Standards Track Created: 26-Feb-2007 Abs

Re: [Python-3000] PEP Draft: Class Decorators

2007-03-09 Thread Jack Diederich
On Fri, Mar 09, 2007 at 01:21:49PM -0800, Brett Cannon wrote: > On 2/28/07, Collin Winter <[EMAIL PROTECTED]> wrote: > >On 2/28/07, Jack Diederich <[EMAIL PROTECTED]> wrote: > >[snip] > >> History and Implementation > >>

[Python-3000] PEP Draft: Class Decorators

2007-02-28 Thread Jack Diederich
in their two bits it would be appreciated. PEP: 3XXX Title: Class Decorators Version: 1 Last-Modified: 28-Feb-2007 Authors: Jack Diederich Implementation: SF#1671208 Status: Draft Type: Standards Track Created: 26-Feb-2007 Abstract Extending the decorator syntax to allow the

Re: [Python-3000] Assignment decorators

2006-12-09 Thread Jack Diederich
On Fri, Dec 08, 2006 at 11:58:38AM -0800, Brett Cannon wrote: > On 12/8/06, Talin <[EMAIL PROTECTED]> wrote: > > > >One other minor brainstorm before I head off to work: I'd like function > >decorators to work with assignment statements as well as 'def' statements. > > > >Use case: > > > >class

Re: [Python-3000] Assignment decorators

2006-12-08 Thread Jack Diederich
On Fri, Dec 08, 2006 at 11:58:38AM -0800, Brett Cannon wrote: > On 12/8/06, Talin <[EMAIL PROTECTED]> wrote: > > > >One other minor brainstorm before I head off to work: I'd like function > >decorators to work with assignment statements as well as 'def' statements. > > > >Use case: > > > >class

Re: [Python-3000] __nonzero__ vs. __bool__

2006-11-22 Thread Jack Diederich
On Wed, Nov 22, 2006 at 09:36:09AM +0100, Georg Brandl wrote: > Terry Reedy schrieb: > > "Brett Cannon" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > > Why can't the fallback usage just pass the return value from __len__ to > > bool() (forget the C function name) and retu

Re: [Python-3000] yes to class decorators

2006-11-15 Thread Jack Diederich
On Thu, Nov 16, 2006 at 01:06:04AM +0200, tomer filiba wrote: [tomer filiba wrote stuff] I was hoping this thread would go unremarked but it looks like it is picking up some steam. So I'll throw in my two bits: Please for the love of god abandon this thread. It has been done. You weren't there

Re: [Python-3000] iostack, second revision

2006-09-08 Thread Jack Diederich
On Sat, Sep 09, 2006 at 12:24:10AM +0200, Antoine Pitrou wrote: > Le vendredi 08 septembre 2006 ? 15:04 -0400, Jim Jewett a ?crit : > > > What about seek(), seek_relative() and seek_reverse() ? > > > > Why not just borrow the standard symbolic names of cur and end? > > > > seek(pos=0) > >

Re: [Python-3000] The future of exceptions

2006-09-04 Thread Jack Diederich
On Sat, Sep 02, 2006 at 06:36:37PM +0200, Georg Brandl wrote: > While looking at the changes necessary to implement the exception > related syntax changes (except ... as ..., raise without type), > I came across some more substantial things that I think must be discussed. > > * How should exceptio

Re: [Python-3000] Making more effective use of slice objects in Py3k

2006-08-30 Thread Jack Diederich
On Wed, Aug 30, 2006 at 08:56:03PM -0700, Bob Ippolito wrote: > On 8/30/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > Fredrik Lundh wrote: > > > > > not necessarily, but there are lots of issues involved when doing > > > high-performance XML stuff, and I'm not sure views would help quite as > >

Re: [Python-3000] have zip() raise exception for sequences of different lengths

2006-08-30 Thread Jack Diederich
No need to take it back, as a long time python-* list reader I only took your initial post as thinking out loud. List readers can spot similar threads in the future by looking for these three indicators: 1) Behavioral function arguments are discouraged and mostly on your say-so. 2) You didn't t

Re: [Python-3000] find -> index patch

2006-08-27 Thread Jack Diederich
On Mon, Aug 28, 2006 at 01:37:59AM +1000, Nick Coghlan wrote: > Jack Diederich wrote: > > On Sat, Aug 26, 2006 at 07:51:03PM -0700, Guido van Rossum wrote: > >> On 8/26/06, Jack Diederich <[EMAIL PROTECTED]> wrote: > >>> After some benchmarking find()

Re: [Python-3000] find -> index patch

2006-08-26 Thread Jack Diederich
On Sat, Aug 26, 2006 at 07:51:03PM -0700, Guido van Rossum wrote: > On 8/26/06, Jack Diederich <[EMAIL PROTECTED]> wrote: > > After some benchmarking find() can't go away without really hurting > > readline() > > performance. > > Can you elaborate? readline(

Re: [Python-3000] find -> index patch

2006-08-26 Thread Jack Diederich
On Thu, Aug 24, 2006 at 03:48:57PM +0200, Fredrik Lundh wrote: > Michael Chermside wrote: > > >> WOW, I love partition. In all the instances that weren't a simple "in" > >> test I ended up using [r]partition. In some cases one of the returned > >> strings gets thrown away but in those cases it i

Re: [Python-3000] cleaning up *path.py code duplication

2006-08-25 Thread Jack Diederich
ns. -Jack On Fri, Aug 25, 2006 at 05:35:33PM -0700, Guido van Rossum wrote: > Sounds like a great 2.6 project. Beware of things that are > intentionally different between platforms of course! > > --Guido > > On 8/25/06, Jack Diederich <[EMAIL PROTECTED]> wrote: > >

[Python-3000] cleaning up *path.py code duplication

2006-08-25 Thread Jack Diederich
While checking find() uses in the stdlib I noticed that the various path modules have duplicate code and docstrings for some generic path manipulations. Delightfully they even have different implementations and docstrings for identical functions. splitext() is a great bad example - os2emxpath.spli

Re: [Python-3000] find -> index patch

2006-08-23 Thread Jack Diederich
On Wed, Aug 23, 2006 at 02:18:59PM -0700, Guido van Rossum wrote: > Here's the patch (by Hasan Diwan, BTW) for people's perusal. It just > gets rid of all *uses* of find/rfind from Lib; it doesn't actually > modify stringobject.c or unicodeobject.c. It doesn't use > [r]partition()'; someone could l

Re: [Python-3000] find -> index patch

2006-08-23 Thread Jack Diederich
On Wed, Aug 23, 2006 at 02:18:59PM -0700, Guido van Rossum wrote: > Here's the patch (by Hasan Diwan, BTW) for people's perusal. It just > gets rid of all *uses* of find/rfind from Lib; it doesn't actually > modify stringobject.c or unicodeobject.c. It doesn't use > [r]partition()'; someone could l

Re: [Python-3000] Droping find/rfind?

2006-08-22 Thread Jack Diederich
On Tue, Aug 22, 2006 at 06:32:39PM -0700, Guido van Rossum wrote: > At today's sprint, one of the volunteers completed a patch to rip out > find() and rfind(), replacing all calls with index()/rindex(). But now > I'm getting cold feet -- is this really a good idea? (It's been listed > in PEP 3100 f

Re: [Python-3000] gettype

2006-08-01 Thread Jack Diederich
On Tue, Aug 01, 2006 at 07:29:51PM -0700, Talin wrote: > tomer filiba wrote: > > that's surly anachronism :) > > > > o.__class__ is a little more typing and will surely scare newbies. > > moreover, type(x) and x.__class__ can return different things > > (you can fool __class__, but not type()). >

Re: [Python-3000] set literals

2006-07-17 Thread Jack Diederich
On Mon, Jul 17, 2006 at 02:54:14PM -0700, Guido van Rossum wrote: > Hm. Your objections seem to be purely from a performance tuning POV. I > think that if we agree that API-wise this is an improvement (fewer > things to learn, set literals problem solved, and dicts grow some > useful new methods) w

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-28 Thread Jack Diederich
On Fri, Apr 28, 2006 at 01:02:44AM -0400, Terry Reedy wrote: > > "Brett Cannon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I wouldn't want it added without ditching the other two versions as > > well. Personally I would be fine if string.join() stayed and we > > considered

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Jack Diederich
On Thu, Apr 27, 2006 at 10:18:23AM -0700, Alex Martelli wrote: > On 4/27/06, Barry Warsaw <[EMAIL PROTECTED]> wrote: > > On Thu, 2006-04-27 at 10:08 -0700, Aahz wrote: > > > > > While I hate the way it looks, I never have gotten mixed up about the > > > order of arguments since switching to ''.join

Re: [Python-3000] Changing order of class creation

2006-04-24 Thread Jack Diederich
On Mon, Apr 24, 2006 at 10:53:39AM -0500, Ian Bicking wrote: > Here's something for the crazy idea bin... > > Right now class creation looks like: > >class X(base): >y = 'z' > > This gets the things in the () (object), evaluates the body of the class > in a new scope and captures th

[Python-3000] Specializing the dicts in __dict__

2006-04-17 Thread Jack Diederich
In an old thread ("dictionary tuning", 2003[1]) Raymond H laid out the typical use cases of dicts and found there were many subclasses of "typical" and speeding one up hurt the others. The results are in dist/Object/dictnotes.txt A couple of the particular use cases have since been satisfied by

Re: [Python-3000] Is reload() feasible?

2006-04-13 Thread Jack Diederich
On Thu, Apr 13, 2006 at 01:39:43PM -0500, Ian Bicking wrote: > In another thread ("Module Initialization and finalization") reload() > has come up, and some suggestions to improve the reloadability of modules. > > I would like to ask: is reloading feasible at all? Right now reload() > works poo

Re: [Python-3000] PEP 3002: Procedure for Backwards-Incompatible Changes

2006-04-13 Thread Jack Diederich
On Thu, Apr 13, 2006 at 10:07:27AM -0600, Steven Bethard wrote: > This should be pretty similar to the last time I posted it, but now > it's got an official PEP number. Let me know what you think! > > Identifying Problematic Code > > > This PEP proposes to house this

Re: [Python-3000] Iterators for dict keys, values, and items == annoying :)

2006-03-23 Thread Jack Diederich
On Thu, Mar 23, 2006 at 05:27:48PM -0800, Guido van Rossum wrote: > On 3/23/06, Ian Bicking <[EMAIL PROTECTED]> wrote: > > Empty iterator or iterator that produced no items -- from the outside > > it's the same use case. > > I see it as an education issue. Because we have generators, the > iterato