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 want it more a value not a 
reference.


Considering "mat(1,1) = 5" expression, I wish the parser can dynamically map 
"mat(1,1)" to reference of value of that "or anonymous reference" or reference 
defined in class. I don't want to modify the lexical parsing in C++ but failed 
after trying different method in pythonic ways:


decorator: fun -> object mapping, because it just substitute function name with 
new function and cannot read "self" object.


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.


Regards,

Lei Wang


________________________________

CONFIDENTIALITY:This email is intended solely for the person(s) named and may 
be confidential and/or privileged.If you are not the intended recipient,please 
delete it,notify us and do not copy,use,or disclose its contents.

Towards a sustainable earth:Print only when necessary.Thank you.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to