[pypy-svn] r25773 - in pypy/dist/pypy/translator/cli: src test
antocuni at codespeak.net
antocuni at codespeak.net
Thu Apr 13 11:38:33 CEST 2006
Author: antocuni
Date: Thu Apr 13 11:38:25 2006
New Revision: 25773
Modified:
pypy/dist/pypy/translator/cli/src/pypylib.cs
pypy/dist/pypy/translator/cli/test/compile.py
Log:
Added support for negative indexes in lists.
Modified: pypy/dist/pypy/translator/cli/src/pypylib.cs
==============================================================================
--- pypy/dist/pypy/translator/cli/src/pypylib.cs (original)
+++ pypy/dist/pypy/translator/cli/src/pypylib.cs Thu Apr 13 11:38:25 2006
@@ -17,12 +17,12 @@
return this.Count;
}
- public T getitem(int index)
+ public T getitem_nonneg(int index)
{
return this[index];
}
- public void setitem(int index, T value_)
+ public void setitem_nonneg(int index, T value_)
{
this[index] = value_;
}
Modified: pypy/dist/pypy/translator/cli/test/compile.py
==============================================================================
--- pypy/dist/pypy/translator/cli/test/compile.py (original)
+++ pypy/dist/pypy/translator/cli/test/compile.py Thu Apr 13 11:38:25 2006
@@ -26,8 +26,8 @@
def bar(x, y):
lst = [1,2,3,x,y]
- lst.extend([1,2])
- return 0
+ lst[-1] = 42
+ return lst[-1]
f = compile_function(bar, [int, int])
More information about the Pypy-commit
mailing list