Update of /cvsroot/jython/jython/org/python/core
In directory usw-pr-cvs1:/tmp/cvs-serv30810
Modified Files:
CollectionProxy.java CollectionProxy2.java
Log Message:
__finditem__(int): Thow a type error for Map and Dictionary. This
prevents a "for x in Hashtable()". This may be enable again when
CPython figures out if it is a good idea.
Fix #130261.
Index: CollectionProxy.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/CollectionProxy.java,v
retrieving revision 2.2
retrieving revision 2.3
diff -C2 -r2.2 -r2.3
*** CollectionProxy.java 2001/02/01 16:41:10 2.2
--- CollectionProxy.java 2001/02/04 15:34:52 2.3
***************
*** 163,166 ****
--- 163,170 ----
}
+ public PyObject __finditem__(int key) {
+ throw Py.TypeError("loop over non-sequence");
+ }
+
public PyObject __finditem__(PyObject key) {
return Py.java2py(proxy.get(Py.tojava(key, Object.class)));
Index: CollectionProxy2.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/CollectionProxy2.java,v
retrieving revision 2.1
retrieving revision 2.2
diff -C2 -r2.1 -r2.2
*** CollectionProxy2.java 1999/05/17 19:59:37 2.1
--- CollectionProxy2.java 2001/02/04 15:34:52 2.2
***************
*** 95,98 ****
--- 95,102 ----
}
+ public PyObject __finditem__(int key) {
+ throw Py.TypeError("loop over non-sequence");
+ }
+
public PyObject __finditem__(PyObject key) {
return Py.java2py(proxy.get(Py.tojava(key, Object.class)));
|