Top "Iterable" questions

An iterable is an object, such as a string or collection, that can be iterated over, yielding up its members one at a time.

How to put string in a set as an individual item?

I have a string sample = "http://www.stackoverflow.com" I want convert this string to a set final = {"http://www.…

python python-3.x set iterable
Initializing a Set with an Iterable

I want to initialize a Set Implementation (HashSet) in Java with an Iterable. However, the constructor of HashSet doesn't accept …

java set iterable
How to find the index of the nth time an item appears in a list?

Given: x = ['w', 'e', 's', 's', 's', 'z','z', 's'] Each occurrence of s appears at the following indices: 1st: 2 2…

python list indexing iterable
How to make a custom object iterable?

I have a list of custom-class objects (sample is below). Using: list(itertools.chain.from_iterable(myBigList)) I wanted to "…

python list python-3.x iterable
What exactly does "iterable" mean in Python? Why isn't my object which implements `__getitem__()` an iterable?

First I want to clarify, I'm NOT asking what is "iterator". This is how the term "iterable" is defined in …

python iterable
Why there is no getFirst(iterable) method?

Iterables present two methods for getLast public static <T> T getLast(Iterable<T> iterable); public static &…

java collections guava api-design iterable
How do I make a class iterable?

This is my class public class csWordSimilarity { public int irColumn1 = 0; public int irColumn2 = 0; public int irColumn3 = 0; public int irColumn4 = 0; public …

c# class c#-4.0 iterable
Getting attribute error: 'map' object has no attribute 'sort'

I am trying to sort array in increasing order. But getting the following error for the code: a=[] a=map(…

python python-3.x sorting iterable
Java: why can't iterate over an iterator?

I read Why is Java's Iterator not an Iterable? and Why aren't Enumerations Iterable?, but I still don't understand why …

java iterator iterable
Why aren't Enumerations Iterable?

In Java 5 and above you have the foreach loop, which works magically on anything that implements Iterable: for (Object o : …

java enumeration iterable