OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to check if all items in the list are None?

  • Thread starter Thread starter Frankie Ribery
  • Start date Start date
F

Frankie Ribery

Guest
Code:
In [27]: map( lambda f,p: f.match(p), list(patterns.itervalues()), vatids )
Out[27]: [None, <_sre.SRE_Match object at 0xb73bfdb0>, None]

The list can be all None or one of it is an re.Match instance. What one liner check can I do on the returned list to tell me that the contents are all None?
<pre><code>In [27]: map( lambda f,p: f.match(p), list(patterns.itervalues()), vatids )
Out[27]: [None, <_sre.SRE_Match object at 0xb73bfdb0>, None]
</code></pre>

<p>The list can be all <code>None</code> or one of it is an re.Match instance.
What one liner check can I do on the returned list to tell me that the contents are all <code>None</code>?</p>
 

Latest posts

Z
Replies
0
Views
1
zuegelwagen
Z
Top