You could add or prototype this with quasiquotes (
http://quasiquotes.readthedocs.io/en/latest/). You just need to be able to parse the body of your expression as a string into an array. Here is a quick example with a parser that only accepts 2d arrays:
```
# coding: quasiquotes
import numpy as np
from quasiquotes import QuasiQuoter
@object.__new__
class array(QuasiQuoter):
def quote_expr(self, expr, frame, col_offset):
return np.array([
eval('[%s]' % d, frame.f_globals, frame.f_locals)
for d in expr.split('||')
])
def f():
a = 1
b = 2
c = 3
return [$array| a, b, c || 4, 5, 6 |]
if __name__ == '__main__':
print(f())
```
Personally I am not sold on replacing `[` and `]` with `|` because I like that you can visually see where dimensions are closed.