The Little Book of Python Anti-Patterns
docs.quantifiedcode.com
docs.quantifiedcode.com
On the restriction itself, I'm fine with returning, for example, any kind of iterable, whether it's a list, tuple, string or whatever. It depends on context, and python is very much an interface/context kind of language.
As for the anti-example given, that code would not fail in most print contexts:
In [1]: a = None
In [2]: print a
None
A better anti-example might have been: In [3]: for i in a:
...: print i
...:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-6fc9adb94b0c> in <module>()
----> 1 for i in a:
2 print i
3
TypeError: 'NoneType' object is not iterable