While I generally agree with SIM117 (combine with statements where possible), I am wondering if there are cases where there should be exceptions to the rule, in particular asyncio.timeout comes to mind.
I.e. I find the following clearer
async with asyncio.timeout(0.2):
async with line_processor:
await line_processor.stop(0)
Less clear in my opinion:
async with asyncio.timeout(0.2), line_processor:
await line_processor.stop(0)
While this is a minor cosmetic issue, I am wondering if this warrants a configuration option (a list of contextmanagers for which to ignore SIM117), or is to much of an edge case to consider complicating the configuration.
For now I ignore SIM117 for tests, which is the main case in which I trigger these.
While I generally agree with SIM117 (combine with statements where possible), I am wondering if there are cases where there should be exceptions to the rule, in particular
asyncio.timeoutcomes to mind.I.e. I find the following clearer
Less clear in my opinion:
While this is a minor cosmetic issue, I am wondering if this warrants a configuration option (a list of contextmanagers for which to ignore SIM117), or is to much of an edge case to consider complicating the configuration.
For now I ignore SIM117 for tests, which is the main case in which I trigger these.