Python contextlib模块,常用函数和类

下面列出了Python contextlib 模块中定义的常用函数和类,我们从1577个开源Python项目中,按照使用频率进行了排序。

函数和类 使用项目数
1. contextmanager() 用在(1035)个项目中
2. closing() 用在(596)个项目中
3. suppress() 用在(102)个项目中
4. redirect_stdout() 用在(73)个项目中
5. ExitStack() 用在(56)个项目中
6. nested() 用在(43)个项目中
7. ContextDecorator() 用在(22)个项目中
8. redirect_stderr() 用在(13)个项目中
9. __file__() 用在(11)个项目中
10. _GeneratorContextManager() 用在(6)个项目中