View Single Post
Old 10-29-2003, 07:01 PM   #24
Kylotan
Member
 
Join Date: Jun 2003
Location: Nottingham, UK
Home MUD: Abattoir (Smaug)
Home MUD: ex-Jellybean (Smaug)
Home MUD: ex-Dark Chambers (Merc)
Posts: 174
Kylotan is on a distinguished road
Send a message via ICQ to Kylotan Send a message via AIM to Kylotan Send a message via MSN to Kylotan Send a message via Yahoo to Kylotan
I've never used Jython and can't really see why it would return all that, but I assume there's a good reason.

If you only wanted the count, wouldn't one of these work?:
myHash.size()
len(myHash)

If not, a simple method of counting the number of elements that an iterator will yield to you is this:

len([x for x in myHash.elements() ])

Basically you make it into a list and grab its length.
Kylotan is offline   Reply With Quote