Unnecessary list comprehension - 'any' can take a generator
authorHugo <hugovk@users.noreply.github.com>
Mon, 14 May 2018 13:15:12 +0000 (16:15 +0300)
committerHugo <hugovk@users.noreply.github.com>
Mon, 14 May 2018 13:16:30 +0000 (16:16 +0300)
tests/test_api.py

index 664951c3ae7c02eb407e629d19bd9638ce431b01..53a339795528fbea96ae671bb8d7235f667ad5d4 100644 (file)
@@ -397,7 +397,7 @@ class TweepyAPITests(TweepyTestCase):
     def testgeoapis(self):
         def place_name_in_list(place_name, place_list):
             """Return True if a given place_name is in place_list."""
-            return any([x.full_name.lower() == place_name.lower() for x in place_list])
+            return any(x.full_name.lower() == place_name.lower() for x in place_list)
 
         twitter_hq = self.api.geo_similar_places(lat='37.7821120598956',
                                                  long='-122.400612831116',