The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

Marko Rauhamaa marko at pacujo.net
Sat Mar 12 17:57:01 EST 2016


Chris Angelico <rosuav at gmail.com>:

> On Sun, Mar 13, 2016 at 9:10 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
>> Chris Angelico <rosuav at gmail.com>:
>>
>>> I completely agree with you that the keyword should mean
>>> "write-once" or "never rebind".
>>
>> That would be possible. I'm afraid that would result in people
>> sprinkling these "constant" keywords everywhere to make the program
>> supposedly run faster. -- Something like that has happened with the
>> "final" keyword in some Java houses.
>>
>> That would prevent the ad hoc installation of wrappers, debugging
>> tools etc.
>
> Hmm. I wonder if it should be like "assert" - nobody ever should
> depend 100% on it, but it's a hint back to the interpreter that you
> should never be rebinding this.

Just wait and see what will happen.

BTW, Java's "final" keyword is additionally used to declare that a
method is not overridden. I once worked in a Java company where the
policy was to declare *everything* final until you knew that you needed
to inherit.


Marko



More information about the Python-list mailing list