On May 4, 9:19 am, John Nagle <[EMAIL PROTECTED]> wrote: > > ... def g(): > > ... x = x + 1 > > Too cute. Don't nest functions in Python; the scoping model > isn't really designed for it.
How can you make generators then if you don't nest? > Python probably isn't the right language for N-dimensional optimization > if performance is a major concern. That's a very compute-intensive operation. > I've done it in C++, with heavy use of inlines, and had to work hard to > get the performance up. (I was one of the first to do physics engines for > games and animation, which is a rather compute-intensive problem.) > > If you're doing number-crunching in Python, it's essential to use > NumPy or some other C library for matrix operations, or it's going to > take way too long. I know. I am trying to flesh out a modular optimization proposal for SciPy. Using C++ would defeat the purpose of making it easy to extend the optimizers. I just want to make things as clean and efficient as possible when I stumbled on this python copy problem. Michael. -- http://mail.python.org/mailman/listinfo/python-list