You can write a list comprehension in Python on its own, and it will execute. You do not need to assign a list comprehension to a variable if the list comprehension itself can do what you want in the final list output and you don't need the list afterwards.
Let's take this bit of code (a method on a Django model).
Python crimes@classmethod def create_stuff(cls): [ cls.objects.create(**dict(item)) for item in itertools.product( [ ("notification_type", notification_type) for notification_type in cls.NOTIFICATION_TYPES ], [ ("delivery_method", delivery_method) for delivery_method in cls.DELIVERY_METHODS ] ) ]
made with @nex3's syntax highlighter
That creates the Django objects!
Probably not that useful outside of code golf, but it makes for some neat one-liners.
