Hi Christian, On Mon, Dec 26, 2005 at 01:38:37PM +0100, Christian Tismer wrote: > I don't think your code has to decide about this. The power lies > in the fact that you don't specify that, but just use the list > in a different way. We do this in the PyPy implementation; > right now it is true that we have a static analysis, but a JIT > is to come, and I'm pretty sure it will try to use an array > until something gets used like a list.
You are mentioning confusingly many levels of PyPy for this argument. This is not directly related to static analysis nor to the JIT. The point is just that while a Python program runs, the implementation can decide to start using a deque-like structure instead of a zero-based array for a given user list. This can be done in any implementation of Python; both in PyPy and in CPython it would be done by adding checks and cases in the code that implements list objects. As much as I like this approach I fear that it will be rejected for CPython, as e.g. lazily concatenated string objects were, on grounds of code obfuscation and unpredictability of performance. But it's PyPy's goal to experiment here :-) A bientot, Armin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com