A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2008-July/081515.html below:

[Python-Dev] Infix operators

[Python-Dev] Infix operatorsGreg Ewing greg.ewing at canterbury.ac.nz
Thu Jul 24 04:05:01 CEST 2008
Sebastien Loisel wrote:

> Essentially, in almost all applications, inv(A) is entirely wrong. You 
> can ask any numerical analyst who works with large problems, and they 
> will confirm it. One of the main reason is that, even if A is sparse, 
> inv(A) is full.

This argues for a function such as solve(A, b). It
doesn't argue for an infix operator.

> But why not put in this infix possibility?

Guido is on record as opposing any kind of macros
or other "extensible syntax", and this probably comes
under the same heading.

Besides which there are technical difficulties, such
as how the parser is supposed to know the precedence
of these user-defined operators.

To address your original problem, I believe that numpy
comes with a matrix type that defines * as matrix
multiplication. That's the usual Python solution to
these kinds of things -- rather than invent a new
operator, invent a new type that behaves the way
you want.

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4