Re: [Python-3000] Draft PEP: Dropping PyObject_HEAD

2007-04-28 Thread Giovanni Bajo
On 28/04/2007 0.44, Martin v. Löwis wrote: > PEP: 3122 > Title: Dropping PyObject_HEAD > Version: $Revision: 54998 $ > Last-Modified: $Date: 2007-04-27 10:31:58 +0200 (Fr, 27 Apr 2007) $ > Author: Martin v. Löwis <[EMAIL PROTECTED]> > Status: Draft > Type: Standards Track > Content-Type: text/x-rs

Re: [Python-3000] ABC PEP isinstance issue Was: PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Calvin Spealman
On 4/26/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 4/25/07, Jim Jewett <[EMAIL PROTECTED]> wrote: > > The current ABC proposal is to use isinstance as the test; Jeffrey > > Yaskin's numbers PEP highlighted the weakness there with a concrete > > example. > > > > If you need to an abstracti

Re: [Python-3000] Draft PEP: Dropping PyObject_HEAD

2007-04-28 Thread Daniel Stutzbach
To facilitate migration, I have a few suggestions: - add the new access macros to 2.6 (defined appropriately) - in 3.0, instead of removing PyObject_HEAD and company, redefine them appropriately, .e.g, #define PyObject_HEAD PyObject obtype; -- Daniel Stutzbach, Ph.D. President, Stutz

Re: [Python-3000] ABC PEP isinstance issue Was: PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Guido van Rossum
On 4/28/07, Calvin Spealman <[EMAIL PROTECTED]> wrote: > On 4/26/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On 4/25/07, Jim Jewett <[EMAIL PROTECTED]> wrote: > > > The current ABC proposal is to use isinstance as the test; Jeffrey > > > Yaskin's numbers PEP highlighted the weakness there w

Re: [Python-3000] ABC PEP isinstance issue Was: PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Jean-Paul Calderone
On Sat, 28 Apr 2007 07:54:58 -0700, Guido van Rossum <[EMAIL PROTECTED]> wrote: >On 4/28/07, Calvin Spealman <[EMAIL PROTECTED]> wrote: >> On 4/26/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: >> > On 4/25/07, Jim Jewett <[EMAIL PROTECTED]> wrote: >> > > The current ABC proposal is to use isinsta

Re: [Python-3000] ABC PEP isinstance issue Was: PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Guido van Rossum
On 4/28/07, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > Aside from the way in which `x' can already lie: > > >>> class X(object): > ... __class__ = property(lambda self: int) > ... > >>> isinstance(X(), int) > True > >>> > > Is this behavior changed/going to be chan

Re: [Python-3000] PEP 30xx: Access to Module/Class/Function CurrentlyBeing Defined (this)

2007-04-28 Thread Nicko van Someren
On 23 Apr 2007, at 05:17, Terry Reedy wrote: > "Jim Jewett" <[EMAIL PROTECTED]> wrote in > message > news:[EMAIL PROTECTED] > |Functions (including methods) often want access to themselves, > |usually for a private storage location. > > Or for true recursion. At present, a function has

Re: [Python-3000] Draft PEP: Dropping PyObject_HEAD

2007-04-28 Thread Neil Schemenauer
Martin v. Löwis <[EMAIL PROTECTED]> wrote: > I propose the PEP below for Py3k. I think it's a good idea. It would be nice if the PEP included something about forwards compatibility. Ideally, there should be a way to write a module that works with both 2.x and 3.x (e.g. using preprocessor macros)

Re: [Python-3000] ABC PEP isinstance issue Was: PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Calvin Spealman
On 4/28/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 4/28/07, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > Aside from the way in which `x' can already lie: > > > > >>> class X(object): > > ... __class__ = property(lambda self: int) > > ... > > >>> isinstance(X(), i

Re: [Python-3000] ABC PEP isinstance issue Was: PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Guido van Rossum
On 4/28/07, Calvin Spealman <[EMAIL PROTECTED]> wrote: > On 4/28/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On 4/28/07, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > > Aside from the way in which `x' can already lie: > > > > > > >>> class X(object): > > > ... __class__ = p

[Python-3000] *View in abc.py not inheriting Iterable Re: PEP 3119 - Introducing Abstract Base Classes

2007-04-28 Thread Samuele Pedroni
Shouldn't the various *View in abc.py be Iterables (inherit from Iterable) ? ___ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive

Re: [Python-3000] *View in abc.py not inheriting Iterable Re: PEP 3119 - Introducing Abstract Base Classes

2007-04-28 Thread Guido van Rossum
On 4/28/07, Samuele Pedroni <[EMAIL PROTECTED]> wrote: > Shouldn't the various *View in abc.py be Iterables (inherit from Iterable) ? Oops, it looks like this is a mess. There are two classes _MappingView. Ignore them for the sake of the PEP. I'll clean them up later. We probably need fewer mappin

[Python-3000] isinstance(., Iterable) vs lookup('__iter__') != None Re: *View in abc.py not inheriting Iterable Re: PEP 3119 - Introducing Abstract Base Classes

2007-04-28 Thread Samuele Pedroni
Guido van Rossum wrote: > On 4/28/07, Samuele Pedroni <[EMAIL PROTECTED]> wrote: >> Shouldn't the various *View in abc.py be Iterables (inherit from >> Iterable) ? > > Oops, it looks like this is a mess. There are two classes > _MappingView. Ignore them for the sake of the PEP. I'll clean them up

Re: [Python-3000] isinstance(., Iterable) vs lookup('__iter__') != None Re: *View in abc.py not inheriting Iterable Re: PEP 3119 - Introducing Abstract Base Classes

2007-04-28 Thread Guido van Rossum
On 4/28/07, Samuele Pedroni <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > On 4/28/07, Samuele Pedroni <[EMAIL PROTECTED]> wrote: > >> Shouldn't the various *View in abc.py be Iterables (inherit from > >> Iterable) ? > > > > Oops, it looks like this is a mess. There are two classes > > _M

Re: [Python-3000] isinstance(., Iterable) vs lookup('__iter__') != None Re: *View in abc.py not inheriting Iterable Re: PEP 3119 - Introducing Abstract Base Classes

2007-04-28 Thread Samuele Pedroni
Guido van Rossum wrote: > On 4/28/07, Samuele Pedroni <[EMAIL PROTECTED]> wrote: >> Guido van Rossum wrote: >> > On 4/28/07, Samuele Pedroni <[EMAIL PROTECTED]> wrote: >> >> Shouldn't the various *View in abc.py be Iterables (inherit from >> >> Iterable) ? >> > >> > Oops, it looks like this is a me

Re: [Python-3000] ABC PEP isinstance issue Was: PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Phillip J. Eby
At 09:17 AM 4/28/2007 -0700, Guido van Rossum wrote: >On 4/28/07, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > Aside from the way in which `x' can already lie: > > > > >>> class X(object): > > ... __class__ = property(lambda self: int) > > ... > > >>> isinstance(X(), int)

Re: [Python-3000] PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Jeffrey Yasskin
On 4/25/07, Jim Jewett <[EMAIL PROTECTED]> wrote: > On 4/25/07, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > > class MonoidUnderPlus(Abstract): > > Is this useful? Just because two things are both Monoid instances > doesn't mean I can add them -- they have to be part of the same > Monoid. By

Re: [Python-3000] PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Baptiste Carvello
Bill Janssen a écrit : >> Jeffrey, is there any way you can drop the top of the tree and going >> straight from Number to Complex -> Real -> Rational -> Integer? These >> are the things that everyone with high school math will know. > > I think knowledge of the concepts of group, ring, and field i

Re: [Python-3000] [Numpy-discussion] PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Jeffrey Yasskin
On 4/27/07, Alan Isaac <[EMAIL PROTECTED]> wrote: > On Fri, 27 Apr 2007, Jeffrey Yasskin wrote: > > Then again, doubles aren't a group either because of this > > imprecision, and I'm suggesting claiming they're > > a subclass of that, so maybe there's room in a practical > > language to make them a

Re: [Python-3000] PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Adam Olsen
On 4/28/07, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > On 4/25/07, Jim Jewett <[EMAIL PROTECTED]> wrote: > > On 4/25/07, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > > > class MonoidUnderPlus(Abstract): > > > > Is this useful? Just because two things are both Monoid instances > > doesn't mea

Re: [Python-3000] PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Jeffrey Yasskin
Thanks for the comments! On 4/26/07, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > > Forgive my ignorance, but I'm not really sure what this PEP is trying to > do. I don't want to sound negative, I really just don't understand the > purpose. I've just never encountered a problem this that I ca

Re: [Python-3000] Draft PEP: Dropping PyObject_HEAD

2007-04-28 Thread Greg Ewing
Martin v. Löwis wrote: > I expect access to ob_type is frequent in Foo_Check() macros; > those need to be rewritten to use Py_Type(op). Maybe some of this breakage could be repaired by renaming the real ob_type field and doing something like #define ob_type ob_base._ob_type -- Greg __

Re: [Python-3000] ABC PEP isinstance issue Was: PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

2007-04-28 Thread Greg Ewing
Guido van Rossum wrote: > On 4/28/07, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > >>>>> class X(object): >>... __class__ = property(lambda self: int) > > I'm not particularly enamored with it, but I believe it once served a > purpose for Zope. Does anyone know if it is still need