Bugs item #878908, was opened at 2004-01-17 17:05
Message generated for change (Settings changed) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=878908&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Works For Me
Priority: 5
Submitted By: Colin J. Williams (cjwhrh)
Assigned to: Nobody/Anonymous (nobody)
Summary: suspect documentation of operator.isNumberType 

Initial Comment:
The docs appear to draw a distinction between
containers and simple classes.  I had expected the
NumberType to include IntType, LongType, FloatType,
ComplexType and, perhaps BoolType, but no others.

The attached script shows that it includes the
BoolType, but it also includes the numarray.array.

On the other hand, it does not include array.array.

This is to suggest that either the docs be clarified or
a probably bug be reported.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2004-01-18 04:49

Message:
Logged In: YES 
user_id=31435

Sorry, I don't understand your point.  bool is a subtype of int, 
so of course it "acts like a number".  numarray isn't part of 
the Python core, so the core Python docs have nothing to 
say about it.  It seems reasonable to me for a numarray.array 
to say it's numeric, because it supports numeric operations 
(for example, you can add 1 to a numeric.array, and it 
broadcasts the scalar; you cannot add 1 to an array.array -- 
there's nothing number-like about array.arrays).

More formally, numarray.array fills in the type object's 
tp_as_number slot at the C level, while array.array does not.  
That's the only clue Python has as to whether a type 
is "number-like", and is (almost) the only thing the 
implementation of isNumberType looks at.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=878908&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to