Neal Becker wrote:
> One possible way to improve the situation is, that if we really believe
> python cannot easily support such optimizations because the code is too
> "dynamic", is to allow manual annotation of functions. For example, gcc
> has allowed such annotations using __attribute__ for qu
One possible way to improve the situation is, that if we really believe
python cannot easily support such optimizations because the code is too
"dynamic", is to allow manual annotation of functions. For example, gcc
has allowed such annotations using __attribute__ for quite a while. This
would al
[Neal Becker]
> >>I don't know to what extent these kind of optimizations are
available to
> >>cpython. For example, are constant calculations removed from loops?
[Brett Cannon]
> > If you mean ``2+3``, then yes.
[Greg Ewing]
> Actually, no. Constant folding *could* be done, but it currently
i
Brett Cannon wrote:
>>I don't know to what extent these kind of optimizations are available to
>>cpython. For example, are constant calculations removed from loops?
>
> If you mean ``2+3``, then yes.
Actually, no. Constant folding *could* be done, but it currently isn't:
>>> def f():
... re
On 9/15/05, Neal Becker <[EMAIL PROTECTED]> wrote:
> I use cpython. I'm accustomed (from c++/gcc) to a style of coding that is
> highly readable, making the assumption that the compiler will do good
> things to optimize the code despite the style in which it's written. For
> example, I assume con
Hi Neal,
I don't believe that cpython currently does any of the optimizations you refer to below. That said, it is very reasonable to adopt "a style of coding that is highly readable, making the assumption that the compiler will do good things" when coding in Python. Python is one of the most h
On Thu, Sep 15, 2005, Neal Becker wrote:
>
> I use cpython. I'm accustomed (from c++/gcc) to a style of coding
> that is highly readable, making the assumption that the compiler will
> do good things to optimize the code despite the style in which it's
> written. For example, I assume constants a
I use cpython. I'm accustomed (from c++/gcc) to a style of coding that is
highly readable, making the assumption that the compiler will do good
things to optimize the code despite the style in which it's written. For
example, I assume constants are removed from loops. In general, an entity
is de