[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#790685: ITP: python-conditional -- conditionally enter a context manager



* Colin Watson <cjwatson@debian.org>, 2015-07-01, 09:51:
     # A no-op context manager.
     context = contextlib.contextmanager(lambda: (None for _ in [None]))()

This could be simplified to:

context = contextlib.contextmanager([None].__iter__)()

--
Jakub Wilk


Reply to: