greenlets are lightweight, but if there are enough of them running that a second list of references to them is a problem...well, I'd think you'd probably hit other limitations long before that happens.
> Can anybody suggest some cleaner ways of doing this?
The requirements for the argument to joinall are that it be iterable and support __len__. So in this case that's easily accomplished with a little helper class:
return len(list_of_greenlets) + 1
for g in list_of_greenlet:
Basically itertools.chain() plus __len__.
Also, know that gevent.joinall() collects and returns the greenlets that finish so their results can be inspected. So you'll wind up with that extra list of greenlets no matter what you do :)
Why does it do that? Because code like this is pretty common:
results = gevent.joinall([gevent.spawn(func, x) for x in data])
(You can use iwait() to avoid the list, but you have to be more careful with it.)