Yeah, just a typo. I'm using __iternext__()

On Thu, Sep 17, 2009 at 10:47 AM, Jeff Emanuel <jemanuel@frii.com> wrote:

Perhaps __iternext__() instead of __nextiter__(), or maybe that's
just a typo in your mail.

Cliff Hill wrote:
I'm attempting to build a system that emulates a Jython List, but written in Java. I've got basically all of the systems for it in place, but I've gotten stuck when I try to use the builtin max() function on the object.

When I do the following:

arr = Array.getNew(range(100)) # generates a list from 0 - 99

max(arr)

I get the following exception thrown: java.util.NoSuchElementException

I'm guessing I haven't implemented some method in my emulated class.

>From what I can tell, max() relies on Jython Iterators. I have the __iter__() method implemented, which produces a class that has all of the Iterator<E> methods implemented, plus a __nextiter__() method I found that the PyIterator class uses.

My Array's elements implement all of the "rich comparitor" methods for Jython to see: __eq__(), etc.

I'm lost as to what's missing here.

Currently using Jython 2.5.1RC1, I'll try RC2 here and see if I can resolve it with that (maybe it is a bug that's fixed, I dunno).

Any insight as to what is necessary to make the max() function work would be most appreciated.

--
"I'm not responcabel fer my computer's spleling errnors" - Xlorep DarkHelm
Website: http://darkhelm.org
Sent from Santa Maria, California, United States

------------------------------------------------------------------------------ Come build with us! The BlackBerry&reg; Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33; http://p.sf.net/sfu/devconf

_______________________________________________ Jython-users mailing list Jython-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jython-users



--
"I'm not responcabel fer my computer's spleling errnors" - Xlorep DarkHelm
Website: http://darkhelm.org
Sent from Santa Maria, California, United States