Python is confusing

>>> def simple(): yield 'a'
...
>>> ', '.join(simple())
'a'
>>> def horrible():
...     if ' ' not in False: yield 'a'
...
>>> ', '.join(horrible())
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: sequence expected, generator found
>>>

But it does accept generators!

(Yes, I know what triggers it to say that. It's still horribly misleading.)

2020-01-21T20:49:33-07:00, originally published 2005-11-02T14:40:00+02:00