[Numpy-discussion] Resolving the associativity/precedence debate for @

josef.pktd at gmail.com josef.pktd at gmail.com
Wed Mar 26 07:21:45 EDT 2014


On Mon, Mar 24, 2014 at 8:33 PM, Nathaniel Smith <njs at pobox.com> wrote:
> On Mon, Mar 24, 2014 at 11:58 PM, Charles R Harris
> <charlesr.harris at gmail.com> wrote:
>> On Mon, Mar 24, 2014 at 5:56 PM, Nathaniel Smith <njs at pobox.com> wrote:
>>>
>>> On Sat, Mar 22, 2014 at 6:13 PM, Nathaniel Smith <njs at pobox.com> wrote:
>>> > After 88 emails we don't have a conclusion in the other thread (see
>>> > [1] for background). But we have to come to some conclusion or another
>>> > if we want @ to exist :-). So I'll summarize where the discussion
>>> > stands and let's see if we can find some way to resolve this.
>>>
>>> Response in this thread so far seems (AFAICT) to have pretty much
>>> converged on same-left.
>>>
>>> If you think that this would be terrible and there is some compelling
>>> argument against it, then please speak up! Otherwise, if no-one
>>> objects, then I'll go ahead in the next few days and put same-left
>>> into the PEP.
>>
>>
>> I think we should take a close look at broadcasting before deciding on the
>> precedence.
>
> Can you elaborate? Like what, concretely, do you think we need to do now?

???


"In examples like this, parenthesizing the code aggressively to spell
out the logic, not
only to Stata but also to yourself and anybody else reading it, should
cause no embarrassment.
You need not assume knowledge of Stata's precedence rules that determine
interpretation when several operators are used in one expression. More
importantly,
you may avoid some horrible little bugs." Nicholas J. Cox

Trying to figure out what Stata is using: elementwise operations are
just below their matrix version in operator precedence.
But Stata came late to matrix algebra, and is definitely not like
Matlab or Gauss, or numpy.

Josef



>
> -n
>
> --
> Nathaniel J. Smith
> Postdoctoral researcher - Informatics - University of Edinburgh
> http://vorpus.org
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion



More information about the NumPy-Discussion mailing list