On 27/03/2019 16:15, Bev in TX wrote:

On Mar 27, 2019, at 10:41 AM, Antoon Pardon <antoon.par...@vub.be> wrote:

I don't know. Something like the following is already legal:

f(x)[n] = x * n

And it does something completly different.

Where would I find information on what this does in the documentation?

Nowhere in particular, it's a consequence of putting things together. The part that Antoon isn't mentioning is that he's presuming the function f(x) returns a list or something similar that we can then index. You're more likely to see that sort of code written as:

a = f(x)
a[n] = x *n

which makes it look a lot less magical.

--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to