From: Steve C. <St...@ig...> - 2002-01-18 15:53:31
|
All right, here is a distillation of what I thought was a stupid newbie question last night, but now I'm genuinely puzzled: >>> from java.util import Hashtable >>> h=3DHashtable() >>> h {} >>> h.put("2","3") >>> h.put("1","2") >>> h {2=3D3, 1=3D2} >>> e=3Dh.elements() >>> e java.util.Hashtable$Enumerator@5b5427 >>> e.hasNextElement() Traceback (innermost last): File "<console>", line 1, in ? AttributeError: hasNextElement >>> e.hasNext() 1 >>> e.nextElement() '3' >>> e.nextElement() '2' >>> h.elements returns a java.util.Enumeration That interface has hasNextElement() and nextElement() methods. It does not have a hasNext() method. Yet under jython, hasNextElement() is not recognized while hasNext() is recognized. What is going on here? |