Return True if item is empty string
<p>Please consider this snippet:</p>

<pre><code>&gt;&gt;&gt; i = ["", 1, 2]
&gt;&gt;&gt; all([x for x in i])
False
</code></pre>

<p>What would be Pythonic way to make this snippet return <code>True</code> even if item in iterable is empty string?</p>

<p>Standard restrictions should apply - if item is <code>None</code> or <code>False</code> etc, it should return False as expected.</p>

<p>You can use <a href="https://docs.python.org/2/library/functions.html#all" rel="nofollow">all</a>, for instance:</p>

<pre><code>tests = [
    [None, False, "", 1, 2],
    ["", 1, 2],
    [1, 2],
    []
]

for i in tests:
    print i
    print all(filter(lambda x: x != '', i))
    print all(True if x == '' else x for x in i)
    print '-' * 80
</code></pre>

python