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

2007-04-29 Thread Guido van Rossum
On 4/29/07, Jim Jewett <[EMAIL PROTECTED]> wrote: > On 4/29/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > Hmm... Maybe the conclusion to draw from this is that we shouldn't > > make Ring a class? Maybe it ought to be a metaclass, so we could ask > > i

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

2007-04-29 Thread Guido van Rossum
On 4/29/07, Jim Jewett <[EMAIL PROTECTED]> wrote: > Or isexample, so that we aren't locked into implementing ABCs as base classes. You don't have to use the feature even if it exists. :-) I think there are good reasons to support overriding isinstance/issubclass beyond ABC

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

2007-04-29 Thread Guido van Rossum
On 4/29/07, Talin <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > Maybe we should stop trying to capture radically different > > mathematical number systems using classes or types, and limit > > ourselves to capturing the systems one learns in high school: C, R

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

2007-04-29 Thread Guido van Rossum
for Python's numeric classes I think it's better to make Complex a regular class representing all the usual complex numbers (i.e. a pair of Real numbers). I expect that the complex subclasses used in practice are all happy under mixed arithmetic using the usual definition of mixed arit

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

2007-04-27 Thread Guido van Rossum
- inf, for instance). This suddenly makes me think of a new idea -- perhaps we could changes the type of Inf and NaNs to some *other* numeric type? We could then reserve a place in the numeric hierarchy for its abstract base class. Though I don't know if this extends to complex numbers with on

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

2007-04-26 Thread Guido van Rossum
, since inheritance is controlled by the > wrong party in most cases and comes with unrelated features that are, > at best, irrelevant to the particular use case and at worst actively > detrimental. > > I'm sure a way around this can be invented, I just don't see why it &

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

2007-04-26 Thread Guido van Rossum
On 4/25/07, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > On 4/25/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > Jeffrey, is there any way you can drop the top of the tree and going > > straight from Number to Complex -> Real -> Rational -> Integer? These &

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

2007-04-26 Thread Guido van Rossum
on these things. (Nothing a quick look at wikipedia can't refresh though.) 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