On Tue, Feb 21, 2012 at 10:34 AM, Waldemar Kornewald
<[email protected]> wrote:
> Hi Luke,
> in one of the mailing list threads you guys were wondering why Daniel
> switched from @{{...}} to %(...)s and pyjslib_name() for built-ins.
> The reason for using Daniel's method is that it's more correct. The
> @{{...}} construct creates a lookup, so code like this wouldn't work,
> anymore:
>
> def f():
>    dict = 'hey'
>    x = {}
>
> If in the last line the "{}" expr becomes @{{dict}}() then the whole
> code will fail because @{{dict}} would be the string 'hey'. The
> @{{...}} construct must never be used in the compiler to resolve
> built-ins. We should check the compiler at some point and fix this
> stuff by using Daniel's solution everywhere (except for local variable
> lookups of course).

 an explanation, yaay!

 ok i like it.  fortunately the replacement can be automated.

 l.

Reply via email to