Message307157
> But it got me thinking - couldn't suppress (and possibly other)
> contextlib decorators support this usage out of the box?
They possibly could but probably shouldn't. My experience is that giving them a dual role makes them more complicated and harder to understand.
For suppress() in particular, wrapping a whole function is likely an anti-pattern. Usually we advise people to put as little as possible in the try-block to avoid catching unexpected exceptions.
Also, I think it would be inevitable that people would try to apply these to generators or awaitables and find that they don't mix well. |
|
Date |
User |
Action |
Args |
2017-11-28 19:50:20 | rhettinger | set | recipients:
+ rhettinger, jaraco |
2017-11-28 19:50:20 | rhettinger | set | messageid: <1511898620.24.0.213398074469.issue32158@psf.upfronthosting.co.za> |
2017-11-28 19:50:20 | rhettinger | link | issue32158 messages |
2017-11-28 19:50:20 | rhettinger | create | |
|