numpy magic: cast scalar returns auto to python types float & int ?

Robert Kern robert.kern at gmail.com
Sat Nov 18 21:31:48 CET 2006


robert wrote:
> There remains the argument, that (float64,int32) scalars coming out should - by default - support the array interface. 
> How many people are there to expect and use this? I'd have never noticed it, if it wouldn't have been mentioned here. Have never seen such code nor seen somewhere or felt myself such a requirement. Thats very special an maybe can be turned on by a global option - if there is more than a handful of users for that.

It derived from our experience building scipy. Writing a library of functions
that work on scalars, vectors and higher-dimensional arrays requires either a
certain amount of generic behavior in its types or a lot of hairy code. We went
for the former. "Global options" affecting the behavior of types don't fit very
well in a library.

> I still think this is over-design and that it brings much much more disadvantages than advantages to let these beasts out by default into a general purpose language like python.

It's a judgement call. You judged differently than we have. <shrug>

> I think I'll stay as a voice to vote heavily against that scheme of numpy scalar types. 11 on a scale from 0 to 10 :-)

Vote all you like; no one's taking a poll at this time.

[I wrote:]
>> And yet again, the best place for numpy questions is the numpy mailing list, not
>> here. Here, you will get maybe one or two people responding to you, usually me,
>> and I'm a cranky SOB. There you will get much nicer people answering your
>> questions and more fully.
>>
>>   http://www.scipy.org/Mailing_Lists
> 
> Maybe once I take the hurdle to use this. Access and searching on such lists is somewhat proprietry. Numerics is a major field in Python land. There are also lots of cross relations to other libs and techniques.  Maybe there could be a nntp-comfortable comp.lang.python.numeric for users - and also a comp.lang.python.net, comp.lang.python.ui. I think that would greatly strentghen Pythons "marketing" in the numerics domain. main clp's posting frequency is too high anyway meanwhile.

When you have to put "numpy" in your subject lines because you're asking
questions about how and why numpy does this one particular thing, it's time to
think about posting to the appropriate list. If you need NNTP, use GMane.

  http://dir.gmane.org/gmane.comp.python.numeric.general

Here's the root of the problem: many of the people you want to talk to aren't
here. They don't read comp.lang.python; mostly it's just me, and I'm getting
crankier by the character.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Python-list mailing list