Open ArneBachmann opened 6 years ago
If you want this, you should just use a numpy
array. We have multidimensional array literals, but they don't yield numpy
arrays by default unless fed them. Perhaps a n[1, 2;; 3, 4]
syntax for a numpy
array literal would be desirable here?
The problem with n[...]
is that it conflicts with indexing the variable n
. If we want to do this, we need some other syntax for this.
Also, if you want the n[...]
syntax for numpy
arrays to work, it's pretty easy to get it yourself via:
operator n
from numpy import asarray as (n)
n[1, 2] |> print
What about allowing in-place operations for tuples like so:
I guess the problem is how to define the semantics, as many different behaviour are imaginable (like += for first element but /= for second). Also it's nothing Python-typical other than allowing tuple-assignment like
(a, b) = (b * 2, a +1)