Why we will use obj$func() often

Michele Simionato michele.simionato at poste.it
Wed Apr 28 10:37:12 EDT 2004


"Mark Hahn" <mark at prothon.org> wrote in message news:<5vJjc.13116$Qy.1954 at fed1read04>...
> I feel strongly that the Python mixture of declaration (global), default
> (where assigned) and broken (closures) is broken overall and has to be fixed
> in Prothon.  I take this as a given.  So I see these possible solutions:
> 
> 1) My Ruby-like symbols, which I think are readable and fast-compilable.
> 
> 2) Word-like symbols, which are large, less readable (too me) and
> cluttering.
> 
> 3) Declarations, which cause the compiler and user to look around and are
> not Pythonic.
> 
> Am I missing any other solutions?

You can use a different assignement syntax for outer scope variables;
for instance in Scheme there is "set!" which can do that.
BTW, I do not think the ability to have read-write closures is that
useful in an OOP language; just use objects. I would ignore this
"issue". OTOH, I do agree that Python scope rules are not 100%
perfect,
but I would content myself with changing the rule for "for" loops (see
http://groups.google.it/groups?hl=it&lr=&ie=UTF-8&oe=UTF-8&threadm=95aa1afa.0402272327.29828430%40posting.google.com&rnum=1&prev=/groups%3Fhl%3Dit%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3Dsimionato%2Bscope%2Brules%26btnG%3DCerca%26meta%3Dgroup%253Dcomp.lang.python.*)

  Michele Simionato



More information about the Python-list mailing list