This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients jaraco, rhettinger
Date 2017-11-28.19:50:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511898620.24.0.213398074469.issue32158@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2017-11-28 19:50:20rhettingersetrecipients: + rhettinger, jaraco
2017-11-28 19:50:20rhettingersetmessageid: <1511898620.24.0.213398074469.issue32158@psf.upfronthosting.co.za>
2017-11-28 19:50:20rhettingerlinkissue32158 messages
2017-11-28 19:50:20rhettingercreate