Re: [Tutor] Python Assignment Expression and Callable Expression

2014-09-18 Thread Steven D'Aprano
On Fri, Sep 19, 2014 at 02:41:31AM +, Wang Lei (ERIAN) wrote: > Hi, everyone: > > I really believe that python is a great language but assignment and callable > are not flexible: > > I wish that I can do this: > > class matrixArray(list): > bla bla bla > def __call__(self, rid, cid): >

Re: [Tutor] Python Assignment Expression and Callable Expression

2014-09-18 Thread Danny Yoo
> I wish python developers could think of an idea to update the lexical > parsing method or simply provide us a tool to modify it in python context. Hi Lei, This is unfortunately out of scope for Python-tutor. We don't have direct influence over the future direction of the language. If you wa

Re: [Tutor] Python Assignment Expression and Callable Expression

2014-09-18 Thread Cameron Simpson
On 19Sep2014 02:41, Wang Lei (ERIAN) wrote: I really believe that python is a great language but assignment and callable are not flexible: Some flexibilities are too much. But there are ways to do what you ask... I wish that I can do this: class matrixArray(list): bla bla bla def __ca

[Tutor] Python Assignment Expression and Callable Expression

2014-09-18 Thread Wang Lei (ERIAN)
Hi, everyone: I really believe that python is a great language but assignment and callable are not flexible: I wish that I can do this: class matrixArray(list): bla bla bla def __call__(self, rid, cid): return self.head[rid][cid] Once I call mat(1,1), I can get a result. but I