Re: [Python-ideas] Python-ideas Digest, Vol 88, Issue 199
#4 seems to refer to the Python basic system. However numpy.array does deal with multi-dimension arrays. On 23-Mar-2014 9:08 PM, python-ideas-request@python.org wrote:
------------------------------ Message: 4 Date: Mon, 24 Mar 2014 11:49:43 +1100 From: Steven D'Aprano
To: python-ideas@python.org Subject: Re: [Python-ideas] [RFC] draft PEP: Dedicated infix operators for matrix multiplication and matrix power Message-ID: <20140324004943.GX16526@ando> Content-Type: text/plain; charset=us-ascii On Sun, Mar 23, 2014 at 11:40:10AM +0100, Sturla Molden wrote: On 15/03/14 01:09, Antoine Pitrou wrote:
Really? That should be up to the third-party library implementing the @ operator for its types, not to the language itself: Python _suggests_ an use case for @, it doesn't mandate it (especially as there's no appropriate data type in the stdlib). array.array is an appropriate type for supporting @ for matrix multiplication. No it isn't. The PEP even discusses it:
[quote] array objects cannot represent multidimensional data at all, which makes ``__matmul__`` much less useful. Second, providing a quality implementation of matrix multiplication is highly non-trivial. Naive nested loop implementations are very slow and providing one in CPython would just create a trap for users. But the alternative -- providing a modern, competitive matrix multiply -- would require that CPython link to a BLAS library, which brings a set of new complications. In particular, several popular BLAS libraries (including the one that ships by default on OS X) currently break the use of ``multiprocessing`` [#blas-fork]_. And finally, we'd have to add quite a bit beyond ``__matmul__`` before ``memoryview`` or ``array.array`` would be useful for numeric work -- like elementwise versions of the other arithmetic operators, just to start. [end quote]
"Colin J. Williams"
#4 seems to refer to the Python basic system.
Howdy Colin. To participate in a discussion, please respond to individual messages so the threads of discussion make sense. To do that, first change your subscription to disable “digest” mode URL:http://www.list.org/mailman-member/node27.html so that you receive the individual messages in the discussion. -- \ “If I had known what it would be like to have it all... I might | `\ have been willing to settle for less.” —Jane Wagner, via Lily | _o__) Tomlin | Ben Finney
On 3/23/2014 11:00 PM, Ben Finney wrote:
"Colin J. Williams"
writes: #4 seems to refer to the Python basic system.
Howdy Colin. To participate in a discussion, please respond to individual messages so the threads of discussion make sense.
To do that, first change your subscription to disable “digest” mode URL:http://www.list.org/mailman-member/node27.html so that you receive the individual messages in the discussion.
Or disable mail messages and access the list as newsgroup gmane.comp.python.ideas as news.gmane.org (as I am because I also do not want a flood of messages to delete). -- Terry Jan Reedy
participants (3)
-
Ben Finney
-
Colin J. Williams
-
Terry Reedy