Adrien Ricocotam wrote:
>>> # Compute the length of each element of the Vector `v`
>>> v.apply(len)
>>> v @ len
Another example with parameters
>>> # Replace all "a" by "b"
>>> v.apply(lambda s: s.replace("a", "b"))
>>> v @ (lambda s: s.replace("a", "b"))
My personal opinion is that the two notations feel good.
But they only cover the special case of a function that takes
elements from just one input vector. What about one that takes
coresponding elements from two or more vectors?
--
Greg
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/